Skip to content

Instantly share code, notes, and snippets.



Created Aug 6, 2019
What would you like to do?
Create Project Table Test
using System;
using ServiceStack;
using ServiceStack.Text;
using ServiceStack.OrmLite;
using ServiceStack.OrmLite.Sqlite;
using ServiceStack.DataAnnotations;
var dbFactory = new OrmLiteConnectionFactory(":memory:", SqliteDialect.Provider);
var db = dbFactory.Open(); // Open ADO.NET DB Connection
public abstract class BaseAuditFields
public DateTime CreatedDate { get; set; }
public string CreatedBy { get; set; }
public DateTime ModifiedDate { get; set; }
public String ModifiedBy { get; set; }
protected BaseAuditFields()
CreatedBy = "sys";
CreatedDate = DateTime.Now;
ModifiedBy = "sys";
ModifiedDate = DateTime.Now;
public class Project : BaseAuditFields
[PrimaryKey, AutoId]
public Guid ProjectId { get; set; }
[Required, StringLength(16), Unique]
public string ProjectCode { get; set; }
[Required, StringLength(100)]
public string ProjectName { get; set; }
public string TranslatedInNos { get; set; }
public int TotalWordCount { get; set; }
<?xml version="1.0" encoding="utf-8"?>
<package id="ServiceStack.Text" version="5.5.0" targetFramework="net45" />
<package id="ServiceStack.Interfaces" version="5.5.0" targetFramework="net45" />
<package id="ServiceStack.Common" version="5.5.0" targetFramework="net45" />
<package id="ServiceStack.OrmLite" version="5.5.0" targetFramework="net45" />
<package id="ServiceStack.OrmLite.Sqlite.Windows" version="5.5.0" targetFramework="net45" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment