Ejemplo n.º 1
0
        public IActionResult ObjectCreate(int typeId, int?parentId, string code)
        {
            if (typeId <= 0)
            {
                throw new ArgumentException($"{typeId} <= 0", nameof(typeId));
            }
            if (parentId.HasValue && parentId <= 0)
            {
                throw new ArgumentException($"{parentId} <= 0", nameof(parentId));
            }
            if (string.IsNullOrWhiteSpace(code))
            {
                throw new ArgumentException("String is NULL / Empty / Whitespace.", nameof(code));
            }


            var objCreate = new ObjectCreateInfo
            {
                TypeId   = typeId,
                ParentId = parentId,
                Code     = code
            };

            _objectsService.Create(objCreate);
            return(Ok());
        }
Ejemplo n.º 2
0
        public Result Create(ObjectCreateInfo objCreate)
        {
            var storageCreateInfo = _mapper.Map <StorageObjectCreateInfo>(objCreate);
            var result            = _objectsStorage.Create(storageCreateInfo);

            if (result.Success)
            {
                _cache.InvalidateAllOfType(typeId: objCreate.TypeId);
            }

            return(result);
        }
Ejemplo n.º 3
0
 internal SelectClauseSyntax(ObjectCreateInfo createInfo, TextPartsBase core)
 {
     _core       = core;
     _createInfo = createInfo;
 }