/// <summary> /// Deletes the specified character. /// </summary> /// <param name="context">The context.</param> /// <param name="id">The identifier.</param> internal static void Delete(DndDmHelperContext context, int id) { context.TemplateCharacters.Remove(context.TemplateCharacters.Find(id)); }
/// <summary> /// Deletes the specified race. /// </summary> /// <param name="context">The context.</param> /// <param name="id">The identifier.</param> internal static void Delete(DndDmHelperContext context, int id) { context.Races.Remove(context.Races.Find(id)); }
/// <summary> /// Initializes a new instance of the <see cref="NoteRepository"/> class. /// </summary> /// <param name="context">The context.</param> public NoteRepository(DndDmHelperContext context) { this.context = context; }
/// <summary> /// Gets all the races. /// </summary> /// <param name="context">The context.</param> /// <returns></returns> internal static IEnumerable <RaceDTO> GetAll(DndDmHelperContext context) { return(context.Races .Select(e => RaceDTO.CreateDTOFromRace(e))); }
/// <summary> /// Gets the dto. /// </summary> /// <param name="id">The identifier.</param> /// <returns></returns> internal static RaceDTO GetDTO(DndDmHelperContext context, int id) { return(context.Races .Select(e => RaceDTO.CreateDTOFromRace(e)) .FirstOrDefault(e => e.ID == id)); }
public static List <Skill> Seed(DndDmHelperContext context) { List <Skill> seed = new List <Skill>(); if (context.Skills.FirstOrDefault(e => e.Name == "Acrobatics") == null) { seed.Add(new Skill() { Name = "Acrobatics", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Animal Handling") == null) { seed.Add(new Skill() { Name = "Animal Handling", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Arcana") == null) { seed.Add(new Skill() { Name = "Arcana", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Athletics") == null) { seed.Add(new Skill() { Name = "Athletics", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Deception") == null) { seed.Add(new Skill() { Name = "Deception", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "History") == null) { seed.Add(new Skill() { Name = "History", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Insight") == null) { seed.Add(new Skill() { Name = "Insight", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Intimidation") == null) { seed.Add(new Skill() { Name = "Intimidation", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Investigation") == null) { seed.Add(new Skill() { Name = "Investigation", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Medicine") == null) { seed.Add(new Skill() { Name = "Medicine", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Nature") == null) { seed.Add(new Skill() { Name = "Nature", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Perception") == null) { seed.Add(new Skill() { Name = "Perception", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Performance") == null) { seed.Add(new Skill() { Name = "Performance", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Persuasion") == null) { seed.Add(new Skill() { Name = "Persuasion", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Religion") == null) { seed.Add(new Skill() { Name = "Religion", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Religion") == null) { seed.Add(new Skill() { Name = "Religion", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Sleight of Hand") == null) { seed.Add(new Skill() { Name = "Sleight of Hand", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Stealth") == null) { seed.Add(new Skill() { Name = "Stealth", Default = true }); } if (context.Skills.FirstOrDefault(e => e.Name == "Survival") == null) { seed.Add(new Skill() { Name = "Survival", Default = true }); } return(seed); }
/// <summary> /// Initializes a new instance of the <see cref="SkillRepository"/> class. /// </summary> /// <param name="context">The context.</param> public SkillRepository(DndDmHelperContext context) { this.context = context; }
/// <summary> /// Initializes a new instance of the <see cref="ClassRepository"/> class. /// </summary> /// <param name="context">The context.</param> public ClassRepository(DndDmHelperContext context) { this.context = context; }
/// <summary> /// Initializes a new instance of the <see cref="UnitOfWork"/> class. /// </summary> public UnitOfWork() { context = new DndDmHelperContext(); }
/// <summary> /// Checks the email is unique. /// </summary> /// <param name="context">The context.</param> /// <param name="emailAddress">The email address.</param> /// <returns></returns> internal static bool CheckUniqueEmail(DndDmHelperContext context, string emailAddress) { return(context.Users.FirstOrDefault(e => e.EmailAddress == emailAddress) == null ? true : false); }
/// <summary> /// Gets the specified user. /// </summary> /// <param name="context">The context.</param> /// <param name="id">The identifier.</param> /// <returns></returns> internal static UserDTO GetDTO(DndDmHelperContext context, int id) { return(context.Users .Select(e => UserDTO.GenerateDTOFromUser(e)) .FirstOrDefault(e => e.ID == id)); }
/// <summary> /// Gets the dto. /// </summary> /// <param name="context">The context.</param> /// <param name="id">The identifier.</param> /// <returns></returns> internal static ClassDTO GetDTO(DndDmHelperContext context, int id) { return(context.Classes .Select(e => ClassDTO.CreateDTOFromClass(e)) .FirstOrDefault(e => e.ID == id)); }
/// <summary> /// Gets all the classes /// </summary> /// <param name="context">The context.</param> /// <returns></returns> internal static IEnumerable <ClassDTO> GetAll(DndDmHelperContext context) { return(context.Classes .Select(e => ClassDTO.CreateDTOFromClass(e))); }
/// <summary> /// Initializes a new instance of the <see cref="GameCharacterRepository"/> class. /// </summary> /// <param name="context">The context.</param> public GameCharacterRepository(DndDmHelperContext context) { this.context = context; }
/// <summary> /// Initializes a new instance of the <see cref="ClassRepository"/> class. /// </summary> /// <param name="context">The context.</param> public BaseStatRepository(DndDmHelperContext context) { this.context = context; }
internal static IEnumerable <SkillDTO> GetAll(DndDmHelperContext context) { return(context.Skills .Select(e => SkillDTO.GenerateDTOFromSkill(e))); }