Exemplo n.º 1
0
        public TotemSetIndexBinder(TotemContext /*!*/ context, CallInfo callInfo)
            : base(callInfo)
        {
            Assert.NotNull(context);

            _context = context;
        }
Exemplo n.º 2
0
        public TotemGetMemberBinder(TotemContext /*!*/ context, string name)
            : base(name, false)
        {
            Assert.NotNull(context);

            _context = context;
        }
Exemplo n.º 3
0
 public CommandValidator(TotemContext dbContext)
 {
     RuleFor(m => m.Description).NotEmpty();
     RuleFor(m => m.ContractString).NotEmpty().StringMustBeValidContract();
     RuleFor(m => m.VersionNumber).NotEmpty().Must(BeAValidVersion).WithMessage("'Version Number' must follow semantic version system.");
     RuleFor(m => m).MustAsync((m, cancellationToken) => ValidationExtensions.IsUniqueContract(m.Id, m.VersionNumber, dbContext, cancellationToken))
     .WithMessage(m => $"Contract Id '{m.Id}' with Version '{m.VersionNumber}' already exist.");
 }
Exemplo n.º 4
0
        public TotemObject(TotemType/*!*/ type)
        {
            Assert.NotNull(type);
            Debug.Assert(type.Handles(GetType()));

            _type = type;
            _context = type.Context;
        }
Exemplo n.º 5
0
 public static Expression Convert(TotemContext state, Type type, ConversionResultKind kind, Expression target)
 {
     return DynamicExpression.Dynamic(
         state.Convert(type, kind),
         type,
         target
     );
 }
Exemplo n.º 6
0
        public TotemConversionBinder(TotemContext/*!*/ context, Type/*!*/ type, ConversionResultKind resultKind, bool retObj)
            : base(retObj ? typeof(object) : type, resultKind == ConversionResultKind.ExplicitCast || resultKind == ConversionResultKind.ExplicitTry)
        {
            Assert.NotNull(context);

            _context = context;
            _kind = resultKind;
            _retObject = retObj;
            _type = type;
        }
Exemplo n.º 7
0
 public CommandValidator(TotemContext dbContext)
 {
     RuleFor(m => m.ModifiedContract.Id).NotEmpty().WithName("Id");
     RuleFor(m => m.ModifiedContract.Description).NotEmpty().WithName("Description");
     RuleFor(m => m.ModifiedContract.ContractString).NotEmpty().StringMustBeValidContract();
     RuleFor(m => m.ModifiedContract.VersionNumber).NotEmpty().WithName("Version Number").Must(BeAValidVersion).WithMessage("'Version Number' must follow semantic version system.");
     RuleFor(m => m).MustAsync((m, cancellationToken) =>
                               ValidationExtensions.IsUniqueContract(m.ModifiedContract.Id, m.ModifiedContract.VersionNumber, dbContext, cancellationToken))
     .WithMessage(m => $"Version {m.ModifiedContract.VersionNumber} is already in use by another contract.")
     .When(x => x.ModifiedContract.Id == x.InitialContract.Id && x.ModifiedContract.VersionNumber != x.InitialContract.VersionNumber);
 }
Exemplo n.º 8
0
        public static DynamicMetaObjectBinder BinaryOperationBinder(TotemContext state, TotemOperationKind operatorName)
        {
            ExpressionType? et = GetExpressionTypeFromBinaryOperator(operatorName);

            if (et == null)
            {
                return state.Operation(
                    operatorName
                );
            }

            return state.BinaryOperation(et.Value);
        }
Exemplo n.º 9
0
 //private LightThrowBinder _lightThrowBinder;
 public TotemInvokeBinder(TotemContext/*!*/ context, CallInfo/*!*/ info)
     : base(info)
 {
     _context = context;
 }
Exemplo n.º 10
0
 public SingleMethodInvokeBinder(TotemContext context, string name, CallInfo callInfo)
     : base(name, false, callInfo)
 {
     _context = context;
 }
Exemplo n.º 11
0
 public Handler(TotemContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 12
0
 public QueryHandler(TotemContext db)
 {
     _db = db;
 }
Exemplo n.º 13
0
            public SplatBinder(TotemContext/*!*/ context)
            {
                ContractUtils.RequiresNotNull(context, "context");

                _context = context;
            }
Exemplo n.º 14
0
 public static DynamicMetaObjectBinder UnaryOperationBinder(TotemContext state, ExpressionType operatorName)
 {
     return state.UnaryOperation(operatorName);
 }
Exemplo n.º 15
0
 /*!*/
 public static DynamicMetaObjectBinder InvokeSplat(TotemContext state)
 {
     return new SplatBinder(state);
 }
Exemplo n.º 16
0
 internal TotemTracebackListener(TotemContext context)
 {
     _totemContext = context;
 }
Exemplo n.º 17
0
 public ContractsController(TotemContext context, IMediator mediator)
 {
     _context  = context;
     _mediator = mediator;
 }
Exemplo n.º 18
0
 public QueryHandler(TotemContext dbContext, IMapper mapper)
 {
     _dbContext = dbContext;
     _mapper    = mapper;
 }
Exemplo n.º 19
0
 public CommandHandler(TotemContext db)
 {
     _db = db;
 }
Exemplo n.º 20
0
 public TotemUnaryOperationBinder(TotemContext/*!*/ context, ExpressionType operation)
     : base(operation)
 {
     _context = context;
 }
Exemplo n.º 21
0
 public TotemConversionBinder(TotemContext/*!*/ context, Type/*!*/ type, ConversionResultKind resultKind)
     : this(context, type, resultKind, false)
 {
 }
Exemplo n.º 22
0
 public QueryHandler(TotemContext db, IMapper mapper)
 {
     _db     = db;
     _mapper = mapper;
 }
Exemplo n.º 23
0
 public CommandHandler(TotemContext db, IMapper mapper)
 {
     _db     = db;
     _mapper = mapper;
 }
 public CompatibilityInvokeBinder(TotemContext context, CallInfo callInfo)
     : base(callInfo)
 {
     _context = context;
 }
Exemplo n.º 25
0
        public static async Task <bool> IsUniqueContract(Guid?contractId, string versionNumber, TotemContext dbContext, CancellationToken cancellationToken)
        {
            var isDuplicateContract = await dbContext.Contract.AnyAsync(x => x.Id == contractId && x.VersionNumber == versionNumber, cancellationToken);

            return(!isDuplicateContract);
        }
Exemplo n.º 26
0
        public TotemBinder(TotemContext totemContext, CodeContext context)
        {
            ContractUtils.RequiresNotNull(totemContext, "totemContext");

            _context = totemContext;
        }
Exemplo n.º 27
0
 public CommandHandler(TotemContext db, IMapper mapper, TesterService testerService)
 {
     _db            = db;
     _mapper        = mapper;
     _testerService = testerService;
 }
Exemplo n.º 28
0
 public TotemOperationBinder(TotemContext context, TotemOperationKind operation)
 {
     _context = context;
     _operation = operation;
 }