Exemplo n.º 1
0
        private Task AddAgentAgencyRelation(Agent agent, AgentAgencyRelationTypes relationType, int agencyId, int[] agentRoleIds)
        {
            _context.AgentAgencyRelations.Add(new AgentAgencyRelation
            {
                AgentId      = agent.Id,
                Type         = relationType,
                AgencyId     = agencyId,
                IsActive     = true,
                AgentRoleIds = agentRoleIds
            });

            return(_context.SaveChangesAsync());
        }
        private Task AddCounterpartyRelation(Agent agent, AgentAgencyRelationTypes relationType, InAgencyPermissions permissions, int agencyId)
        {
            _context.AgentAgencyRelations.Add(new AgentAgencyRelation
            {
                AgentId             = agent.Id,
                Type                = relationType,
                InAgencyPermissions = permissions,
                AgencyId            = agencyId,
                IsActive            = true
            });

            return(_context.SaveChangesAsync());
        }