示例#1
0
 private void Create()
 {
     var CreatedItem = new Profession
     { Name = "Машина"
         //ShortName = "МШ",
         //DepartmentId = 1
     };
     Context.Professions.Add(CreatedItem);
     Context.SaveChanges();
 }
示例#2
0
        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;
        }