mirror of
https://github.com/bitwarden/mobile
synced 2025-12-28 14:13:25 +00:00
initial commit
This commit is contained in:
32
src/App/Models/Data/FolderData.cs
Normal file
32
src/App/Models/Data/FolderData.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using SQLite;
|
||||
using Bit.App.Abstractions;
|
||||
|
||||
namespace Bit.App.Models.Data
|
||||
{
|
||||
[Table("Folder")]
|
||||
public class FolderData : IDataObject<int>
|
||||
{
|
||||
public FolderData()
|
||||
{ }
|
||||
|
||||
public FolderData(Folder folder)
|
||||
{
|
||||
Id = folder.Id;
|
||||
ServerId = folder.ServerId;
|
||||
Name = folder.Name?.EncryptedString;
|
||||
}
|
||||
|
||||
[PrimaryKey]
|
||||
[AutoIncrement]
|
||||
public int Id { get; set; }
|
||||
public string ServerId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public DateTime RevisionDateTime { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public Folder ToFolder()
|
||||
{
|
||||
return new Folder(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
src/App/Models/Data/SiteData.cs
Normal file
44
src/App/Models/Data/SiteData.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using SQLite;
|
||||
using Bit.App.Abstractions;
|
||||
|
||||
namespace Bit.App.Models.Data
|
||||
{
|
||||
[Table("Site")]
|
||||
public class SiteData : IDataObject<int>
|
||||
{
|
||||
public SiteData()
|
||||
{ }
|
||||
|
||||
public SiteData(Site site)
|
||||
{
|
||||
Id = site.Id;
|
||||
ServerId = site.ServerId;
|
||||
FolderId = site.FolderId;
|
||||
ServerFolderId = site.ServerFolderId;
|
||||
Name = site.Name?.EncryptedString;
|
||||
Uri = site.Uri?.EncryptedString;
|
||||
Username = site.Username?.EncryptedString;
|
||||
Password = site.Password?.EncryptedString;
|
||||
Notes = site.Notes?.EncryptedString;
|
||||
}
|
||||
|
||||
[PrimaryKey]
|
||||
[AutoIncrement]
|
||||
public int Id { get; set; }
|
||||
public string ServerId { get; set; }
|
||||
public int? FolderId { get; set; }
|
||||
public string ServerFolderId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Uri { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public DateTime RevisionDateTime { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public Site ToSite()
|
||||
{
|
||||
return new Site(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user