예제 #1
0
        public OwnerDebt Update(OwnerDebt owner)
        {
            var ownerdebt = context.OwnerDebts.Attach(owner);

            ownerdebt.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            context.SaveChanges();
            return(owner);
        }
예제 #2
0
        public OwnerDebt Delete(int Id)
        {
            OwnerDebt owner = context.OwnerDebts.Find(Id);

            if (owner != null)
            {
                context.OwnerDebts.Remove(owner);
                context.SaveChanges();
            }
            return(owner);
        }
예제 #3
0
        public OwnerDebt GetOwnerDebt(int Id)
        {
            OwnerDebt owner = context.OwnerDebts.Find(Id);

            return(owner);
        }
예제 #4
0
 public OwnerDebt Add(OwnerDebt owner)
 {
     context.OwnerDebts.Add(owner);
     context.SaveChanges();
     return(owner);
 }