private void InitializeCathegory(CathegoryModel model, Cathegory cathegory) { cathegory.CathegoryId = Guid.NewGuid(); cathegory.Name = model.Name; }
public void AddCathegory(DataContext db,CathegoryModel model) { Cathegory newCathegory = db.Cathegories.Create(); InitializeCathegory(model,newCathegory); db.SaveChanges(); }