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

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

            _context = context;
        }
Example #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.");
 }
Example #4
0
        public TotemObject(TotemType/*!*/ type)
        {
            Assert.NotNull(type);
            Debug.Assert(type.Handles(GetType()));

            _type = type;
            _context = type.Context;
        }
Example #5
0
 public static Expression Convert(TotemContext state, Type type, ConversionResultKind kind, Expression target)
 {
     return DynamicExpression.Dynamic(
         state.Convert(type, kind),
         type,
         target
     );
 }
        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;
        }
Example #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);
 }
Example #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);
        }
Example #9
0
 //private LightThrowBinder _lightThrowBinder;
 public TotemInvokeBinder(TotemContext/*!*/ context, CallInfo/*!*/ info)
     : base(info)
 {
     _context = context;
 }
 public SingleMethodInvokeBinder(TotemContext context, string name, CallInfo callInfo)
     : base(name, false, callInfo)
 {
     _context = context;
 }
Example #11
0
 public Handler(TotemContext dbContext)
 {
     _dbContext = dbContext;
 }
Example #12
0
 public QueryHandler(TotemContext db)
 {
     _db = db;
 }
Example #13
0
            public SplatBinder(TotemContext/*!*/ context)
            {
                ContractUtils.RequiresNotNull(context, "context");

                _context = context;
            }
Example #14
0
 public static DynamicMetaObjectBinder UnaryOperationBinder(TotemContext state, ExpressionType operatorName)
 {
     return state.UnaryOperation(operatorName);
 }
Example #15
0
 /*!*/
 public static DynamicMetaObjectBinder InvokeSplat(TotemContext state)
 {
     return new SplatBinder(state);
 }
 internal TotemTracebackListener(TotemContext context)
 {
     _totemContext = context;
 }
 public ContractsController(TotemContext context, IMediator mediator)
 {
     _context  = context;
     _mediator = mediator;
 }
Example #18
0
 public QueryHandler(TotemContext dbContext, IMapper mapper)
 {
     _dbContext = dbContext;
     _mapper    = mapper;
 }
Example #19
0
 public CommandHandler(TotemContext db)
 {
     _db = db;
 }
 public TotemUnaryOperationBinder(TotemContext/*!*/ context, ExpressionType operation)
     : base(operation)
 {
     _context = context;
 }
 public TotemConversionBinder(TotemContext/*!*/ context, Type/*!*/ type, ConversionResultKind resultKind)
     : this(context, type, resultKind, false)
 {
 }
Example #22
0
 public QueryHandler(TotemContext db, IMapper mapper)
 {
     _db     = db;
     _mapper = mapper;
 }
Example #23
0
 public CommandHandler(TotemContext db, IMapper mapper)
 {
     _db     = db;
     _mapper = mapper;
 }
 public CompatibilityInvokeBinder(TotemContext context, CallInfo callInfo)
     : base(callInfo)
 {
     _context = context;
 }
Example #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);
        }
Example #26
0
        public TotemBinder(TotemContext totemContext, CodeContext context)
        {
            ContractUtils.RequiresNotNull(totemContext, "totemContext");

            _context = totemContext;
        }
Example #27
0
 public CommandHandler(TotemContext db, IMapper mapper, TesterService testerService)
 {
     _db            = db;
     _mapper        = mapper;
     _testerService = testerService;
 }
 public TotemOperationBinder(TotemContext context, TotemOperationKind operation)
 {
     _context = context;
     _operation = operation;
 }