public AvailableRightModel CreateContractObject(AvailableRightModel data)
 {
     var contractobject = data.ToModel();
     contractobject.LastUpdateDate = DateTime.Now;
     _context.AvailableRights.Add(contractobject);
     _context.SaveChanges();
     data.ID = contractobject.ID;
     return data;
 }
        public int UpdateContractObjectById(AvailableRightModel data)
        {
            var contractobject = _context.AvailableRights.Find(data.ID);

            contractobject.Name = data.Name;
            contractobject.Description = data.Description;
            contractobject.IsActive = data.IsActive;
            contractobject.LastUpdateDate = DateTime.Now;
            _context.Entry(contractobject).State = EntityState.Modified;
            var i = _context.SaveChanges();
            return i;
        }
 public int InsertContractObject(AvailableRightModel data)
 {
     var contractobject = data.ToModel();
     contractobject.LastUpdateDate = DateTime.Now;
     _context.AvailableRights.Add(contractobject);
     var i = _context.SaveChanges();
     return i;
 }