private void Create() { var CreatedItem = new Profession { Name = "Машина" //ShortName = "МШ", //DepartmentId = 1 }; Context.Professions.Add(CreatedItem); Context.SaveChanges(); }
public static Profession GetAllProfession(Int32 Code) { Profession Result; var Profession = AllProfessions.FirstOrDefault(x => x.Code == Code); if (Profession != null) { Result = new Profession(Profession.Id, Profession.Code, Profession.Name, Profession.ShortName); } else { Result = new Profession(); } return Result; }