public TicketRelationship CreateTicketRelationship(IIdentity <Relationship> relationshipId, TicketReference relatedTicketReference, RelationshipParticipant participationType) { if (relationshipId == null || relatedTicketReference == null || !participationType.IsDefinedValue()) { return(null); } var relatedTicket = ticketQuery.GetTicketByReference(relatedTicketReference); if (relatedTicket == null) { return(null); } var relationship = new TicketRelationship { Relationship = data.Theorise(relationshipId), }; if (participationType == RelationshipParticipant.Primary) { relationship.SecondaryTicket = relatedTicket; } if (participationType == RelationshipParticipant.Secondary) { relationship.PrimaryTicket = relatedTicket; } return(relationship); }
public Expression <Func <Project, bool> > GetExpression() { var user = data.Theorise(userId); return(project => user.SiteAdministrator || project.Administrators.Contains(user) || project.Contributors.Contains(user)); }
public Ticket CreateTicket(CreateTicketRequest request) { var ticket = wrappedInstance.CreateTicket(request); ticket.Type = data.Theorise(request.TicketTypeIdentity); return(ticket); }
Project GetProject(ListSprintsRequest request) { if (request.Project != null) { return(data.Theorise(request.Project)); } return(currentProjectProvider.GetCurrentProject()); }
public Ticket CreateTicket(CreateTicketRequest request) { var ticket = wrappedInstance.CreateTicket(request); if (request.SprintIdentity != null) { ticket.Sprint = data.Theorise(request.SprintIdentity); } return(ticket); }
protected override RuleOutcome GetOutcome(EditProjectRequest validated) { if (String.IsNullOrEmpty(validated.Code)) { return(RuleOutcome.Success); } if (validated.Identity == null) { return(RuleOutcome.Success); } var project = data.Theorise(validated.Identity); var hasDuplicateCode = data.Query <Project>() .Any(x => x != project && x.Code == validated.Code); return(hasDuplicateCode ? RuleOutcome.Failure : RuleOutcome.Success); }
public Ticket GetTicket(IIdentity <Ticket> ticket) { if (ticket == null) { throw new ArgumentNullException(nameof(ticket)); } var ticketTheory = repo.Theorise(ticket); return(repo .Query <Ticket>() .Where(x => x == ticketTheory) .FetchChildren(x => x.Comments) .FetchChild(x => x.Type) .ToArray() .FirstOrDefault()); }
public Sprint GetSprint(IIdentity <Sprint> identity) { if (ReferenceEquals(identity, null)) { return(null); } var theory = repo.Theorise(identity); return(repo .Query <Sprint>() .Where(x => x == theory) .FetchChild(x => x.Project) .FetchChildren(x => x.Tickets) .ThenFetchGrandchild(x => x.Type) .ToList() .SingleOrDefault()); }
List <TheoreticalRelationship> GetExistingRelationships(IIdentity <Ticket> ticketIdentity) { if (ReferenceEquals(ticketIdentity, null)) { return(new List <TheoreticalRelationship>()); } var ticket = data.Theorise(ticketIdentity); return((from rel in data.Query <TicketRelationship>() where rel.PrimaryTicket == ticket || rel.SecondaryTicket == ticket select rel) .FetchChild(x => x.Relationship) .AsEnumerable() .Select(MapToTheoreticalRelationship) .ToList()); }
public Expression <Func <Ticket, bool> > GetExpression() { var project = data.Theorise(projectId); return(x => x.Project == project); }