Created
March 7, 2016 14:58
-
-
Save ChrisTowles/e10c843706e5a3f6f778 to your computer and use it in GitHub Desktop.
Azure Mobile SDK Base Model for Sync Entity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Azure.Mobile.Server.Tables; | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.ComponentModel.DataAnnotations.Schema; | |
using System.Linq; | |
using System.Web; | |
namespace Ecrumbs.Service.Data | |
{ | |
public class AzureServerSyncModelBase : ITableData | |
{ | |
public DateTimeOffset DeviceCreatedAt { get; set; } | |
#region Azure Sync Properties | |
[Key] | |
[TableColumn(TableColumnType.Id)] | |
[MaxLength(36)] | |
public string Id { get; set; } | |
[DatabaseGenerated(DatabaseGeneratedOption.Computed)] | |
[TableColumn(TableColumnType.CreatedAt)] | |
public DateTimeOffset? CreatedAt { get; set; } | |
[DatabaseGenerated(DatabaseGeneratedOption.Computed)] | |
[TableColumn(TableColumnType.UpdatedAt)] | |
public DateTimeOffset? UpdatedAt { get; set; } | |
[TableColumn(TableColumnType.Version)] | |
[Timestamp] | |
public byte[] Version { get; set; } | |
[TableColumn(TableColumnType.Deleted)] | |
public bool Deleted { get; set; } | |
#endregion | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment