public void Seeds()
 {
     foreach (var type in _types)
     {
         _typeRepository.Create(type);
     }
 }
        public ValidationResult Handler(CreateTypeCommand command)
        {
            Type type = new Type(command.Definicion, command.Icon);

            Boolean result = _typeRepository.Create(type);

            return(Validate(type));
        }
示例#3
0
        public async Task <Models.DTO.Type> Create(
            CreateType type,
            string tenantId,
            CancellationToken cancellationToken)
        {
            var newType = TypeMapper.MapToDomain(
                type,
                tenantId);

            await _typeRepository.Create(
                newType,
                cancellationToken);

            return(TypeMapper.MapToDto(newType));
        }
示例#4
0
        public async Task <IActionResult> Post(SubscriptionType model)
        {
            try
            {
                model.CreatedDate = DateTime.UtcNow;
                await _typeRepository.Create(model);

                return(Ok(NotificationMessage.TypePostSuccess));
            }
            catch (Exception ex)
            {
                _log.LogError(ex.ToString());
                return(BadRequest(ex.ToString()));
            }
        }
        public IActionResult Save([FromBody] Type type)
        {
            if (type is null)
            {
                return(BadRequest("Type is null."));
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            if (type.TypeId == 0)
            {
                _repository.Create(type);
                return(new JsonResult(new { create = true, type }));
            }
            else
            {
                _repository.Update(type);
                return(new JsonResult(new { update = true, type }));
            }
        }
示例#6
0
        public EnterType Create(string description, int userId)
        {
            var type = new EnterType(description, userId);

            return(_typeRepository.Create(type));
        }
        public void Should_Create_Type_Return_true()
        {
            Boolean ret = _typeRepository.Create(TypeQueriesMock.typeCreated);

            Assert.IsTrue(ret);
        }
示例#8
0
 public Type Create(Type type)
 {
     return(typesRepository.Create(type));
 }
示例#9
0
 public void Post([FromBody] string value)
 {
     _typeRepository.Create(value);
 }
示例#10
0
 public Type CreateType(Type ty)
 {
     return(_typeRepo.Create(ty));
 }