Пример #1
0
 public bool DeleteSharing(Sharing sharingToDelete)
 {
     var sha = contex.Sharings.FirstOrDefault<Sharing>(x =>
         x.ShagrirShareId == sharingToDelete.ShagrirShareId &&
         x.ShagrirSharedId == sharingToDelete.ShagrirSharedId &&
         x.CandidateBeingSharedId == sharingToDelete.CandidateBeingSharedId);
     if (sha != null)
     {
         contex.Sharings.Remove(sha);
         return contex.SaveChanges() > 0;
     }
     else
         return false;
 }
Пример #2
0
        public bool Share(int ownerId, int reciverId, int candidateId)
        {
            Sharing share = new Sharing();
            share.ShagrirShareId = ownerId;
            share.ShagrirSharedId = reciverId;
            share.CandidateBeingSharedId = candidateId;

            return dal.CreateSharing(share);
        }
Пример #3
0
 public bool CreateSharing(Sharing sharingToCreate)
 {
     contex.Sharings.Add(sharingToCreate);
     return contex.SaveChanges() > 0;
 }