Exemplo n.º 1
0
        public static CreateSchemaDto ToRequest(this SchemaCreateModel model)
        {
            var isSingleton = model.IsSingleton;

            var type = model.Type;

            if (model.IsSingleton && type == SchemaType.Default)
            {
                type = SchemaType.Singleton;
            }

            return(new CreateSchemaDto {
                Name = model.Name, IsSingleton = isSingleton, Type = type
            });
        }
Exemplo n.º 2
0
        public static CreateSchemaDto ToCreate(this SchemaCreateModel model)
        {
            var result = SimpleMapper.Map(model, new CreateSchemaDto());

            if (model.IsSingleton && model.SchemaType == SchemaType.Default)
            {
                result.Type = SchemaType.Singleton;
            }
            else
            {
                result.Type = model.SchemaType;
            }

            return(result);
        }
Exemplo n.º 3
0
 public static CreateSchemaDto ToRequest(this SchemaCreateModel model)
 {
     return(new CreateSchemaDto {
         Name = model.Name, IsSingleton = model.IsSingleton
     });
 }