Beispiel #1
0
        public Guarantor UpdateGuarantor(Guarantor guarantorChanges)
        {
            var guarantor = context.guarantors.Attach(guarantorChanges);

            guarantor.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            context.SaveChanges();
            return(guarantorChanges);
        }
Beispiel #2
0
        public Guarantor DeleteGuarantor(int id)
        {
            Guarantor guarantor = context.guarantors.Find(id);

            if (guarantor != null)
            {
                context.guarantors.Remove(guarantor);
                context.SaveChanges();
            }
            return(guarantor);
        }
Beispiel #3
0
 //guarantor process
 public Guarantor AddGuarantor(Guarantor guarantor)
 {
     context.guarantors.Add(guarantor);
     context.SaveChanges();
     return(guarantor);
 }