<commit_before>﻿namespace XShare.Data
{
    using System;
    using System.Collections.Generic;
    using System.Data.Entity;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Microsoft.AspNet.Identity.EntityFramework;
    using Models;

    public class XShareDbContext : IdentityDbContext<User>, IXShareDbContext
    {
        public XShareDbContext()
            : base("DefaultConnection", throwIfV1Schema: false)
        {
        }

        public virtual IDbSet<Car> Cars { get; set; }

        public virtual IDbSet<Rating> Ratings { get; set; }

        public virtual IDbSet<Reservation> Reservations { get; set; }

        public virtual IDbSet<Accident> Accidents { get; set; }

        public virtual IDbSet<Feature> Features { get; set; }

        public static XShareDbContext Create()
        {
            return new XShareDbContext();
        }
    }
}<commit_msg>cascade delete is OK<commit_after>﻿namespace XShare.Data
{
    using System;
    using System.Collections.Generic;
    using System.Data.Entity;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Microsoft.AspNet.Identity.EntityFramework;
    using Models;

    public class XShareDbContext : IdentityDbContext<User>, IXShareDbContext
    {
        public XShareDbContext()
            : base("DefaultConnection", throwIfV1Schema: false)
        {
        }

        public virtual IDbSet<Car> Cars { get; set; }

        public virtual IDbSet<Rating> Ratings { get; set; }

        public virtual IDbSet<Reservation> Reservations { get; set; }

        public virtual IDbSet<Accident> Accidents { get; set; }

        public virtual IDbSet<Feature> Features { get; set; }

        public static XShareDbContext Create()
        {
            return new XShareDbContext();
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder
                .Entity<User>()
                .HasMany(x => x.Reservations)
                .WithRequired(x => x.User)
                .WillCascadeOnDelete(true);

            base.OnModelCreating(modelBuilder);
        }
    }
}
{'fraction_non_alphanumeric': 0.08638025594149909, 'fraction_numerical': 0.0009140767824497258, 'mean_word_length': 2.316666666666667, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2127956', 'n_tokens_mistral': 615, 'n_tokens_neox': 593, 'n_words': 146}