Beispiel #1
0
 public Option <ProjectDto> GetInfo(int userId, int projectId)
 {
     return(_projectMembershipRepository
            .Find(membership => membership.UserId == userId && membership.ProjectId == projectId)
            .Get(membership =>
     {
         return _projectRepository
         .Find(record => record.Id == projectId)
         .Get(
             record => new Option <ProjectDto>(new ProjectDto(record, record.UserId == userId, membership.IsFavourite)),
             () => new Option <ProjectDto>()
             );
     }, () => new Option <ProjectDto>()));
 }
Beispiel #2
0
 public bool VerifyMembership(int userId, int projectId)
 {
     return(_projectMembershipRepository
            .Find(m => m.UserId == userId && m.ProjectId == projectId)
            .Get(m => true, () => false));
 }