Primary Keys
Sauce will assume that there is only one primary key and its name is IDThis can be changed on a per object basis
You can also use this technique to specify more than one.
Two Primary Keys
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccess.Core.Attributes;
namespace SauceExample
{
public class MyObject
{
[Key]
public int keyOne { get; set; }
[Key]
public int keyTwo { get; set; }
public string Name { get; set; }
}
}
Two Primary Keys (one specified one inferred)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccess.Core.Attributes;
namespace SauceExample
{
public class MyObject
{
public int id { get; set; } //this is a primary key
[Key]
public int keyTwo { get; set; } //this is a primary key too
public string Name { get; set; }
}
}
One Primary Keys
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccess.Core.Attributes;
namespace SauceExample
{
public class MyObject
{
[Key]
public int key { get; set; }
public string Name { get; set; }
}
}