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 }); }
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); }
public static CreateSchemaDto ToRequest(this SchemaCreateModel model) { return(new CreateSchemaDto { Name = model.Name, IsSingleton = model.IsSingleton }); }