1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

move all models into core

This commit is contained in:
Kyle Spearrin
2017-03-08 21:55:08 -05:00
parent bd0c960e9f
commit 8bcd4e0463
60 changed files with 64 additions and 64 deletions

View File

@ -1,32 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations;
using Bit.Api.Utilities;
using Bit.Core.Models.Table;
using Newtonsoft.Json;
namespace Bit.Api.Models
{
public class FolderRequestModel
{
[Required]
[EncryptedString]
[StringLength(300)]
public string Name { get; set; }
public Cipher ToCipher(Guid userId)
{
return ToCipher(new Cipher
{
UserId = userId
});
}
public Cipher ToCipher(Cipher existingFolder)
{
existingFolder.Data = JsonConvert.SerializeObject(new FolderDataModel(this), new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore });
existingFolder.Type = Core.Enums.CipherType.Folder;
return existingFolder;
}
}
}