Exemplo n.º 1
0
 public Benefactor Create(Benefactor itemToCreate)
 {
     var benefactor = _context.Benefactors.Add(itemToCreate);
     _context.SaveChanges();
     return benefactor;
 }
Exemplo n.º 2
0
 public Benefactor UpdateBenefactorFromBenefactorEditModel(BenefactorEditModel editModel, Benefactor benefactorModel)
 {
     benefactorModel.FirstName = editModel.FirstName;
     benefactorModel.LastName = editModel.LastName;
     benefactorModel.FullName = (editModel.FirstName + " " + editModel.LastName).Trim();
     benefactorModel.Country = editModel.Country;
     benefactorModel.IdNumber = editModel.IdNumber;
     benefactorModel.BirthDate = editModel.BirthDate;
     benefactorModel.Gender = Utilities.IsMasculino(editModel.Gender);
     benefactorModel.Nationality = editModel.Nationality;
     benefactorModel.State = editModel.State;
     benefactorModel.City = editModel.City;
     benefactorModel.Address = editModel.Address;
     benefactorModel.Capacity = editModel.Capacity;
     return Update(benefactorModel);
 }
Exemplo n.º 3
0
 internal void Detach(Benefactor benefactor)
 {
     _context.Entry(benefactor).State = EntityState.Detached;
 }
Exemplo n.º 4
0
 public Benefactor Update(Benefactor itemToUpdate)
 {
     _context.SaveChanges();
     return itemToUpdate;
 }