public RepositoryActionResult <ClientLawsuit> Update(ClientLawsuit t)
        {
            try
            {
                var existingData = _ctx.ClientLawsuits.FirstOrDefault(exp => exp.Id == t.Id);

                if (existingData == null)
                {
                    return(new RepositoryActionResult <ClientLawsuit>(t, RepositoryActionStatus.NotFound));
                }

                _ctx.Entry(existingData).State = EntityState.Detached;
                _ctx.ClientLawsuits.Attach(t);
                _ctx.Entry(t).State = EntityState.Modified;


                var result = _ctx.SaveChanges();
                if (result > 0)
                {
                    return(new RepositoryActionResult <ClientLawsuit>(t, RepositoryActionStatus.Updated));
                }
                else
                {
                    return(new RepositoryActionResult <ClientLawsuit>(t, RepositoryActionStatus.NothingModified, null));
                }
            }
            catch (Exception ex)
            {
                return(new RepositoryActionResult <ClientLawsuit>(null, RepositoryActionStatus.Error, ex));
            }
        }
 public RepositoryActionResult <ClientLawsuit> Insert(ClientLawsuit t)
 {
     try
     {
         _ctx.ClientLawsuits.Add(t);
         var result = _ctx.SaveChanges();
         if (result > 0)
         {
             return(new RepositoryActionResult <ClientLawsuit>(t, RepositoryActionStatus.Created));
         }
         else
         {
             return(new RepositoryActionResult <ClientLawsuit>(t, RepositoryActionStatus.NothingModified, null));
         }
     }
     catch (Exception ex)
     {
         return(new RepositoryActionResult <ClientLawsuit>(null, RepositoryActionStatus.Error, ex));
     }
 }