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
public class Blah | |
{ | |
[JsonIgnore] | |
public string Property { get; set; } | |
[JsonProperty(Name = "a")] | |
public int AnotherProperty { get; set; } | |
[JsonProperty(Name = "b")] | |
public SomeSuperDuperClass LastProperty { get; set; } |
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
public class Directory | |
{ | |
// ... fields omitted for brevity | |
public DirectoryType Type { get; private set; } | |
} |
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
public class Calendar : Story | |
{ | |
private Region _region; | |
private readonly ISet<Event> _events; | |
public Calendar(Guid id, Region region) | |
{ | |
Id = id; | |
_region = region; |
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
public class Calendar : Story | |
{ | |
private string _region; | |
private readonly ISet<Event> _events; | |
public Calendar(Guid id, string region) | |
{ | |
Id = id; | |
_region = region; |
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
public abstract class Story : AggregateBase | |
{ | |
private readonly ISet<Vote> _votes = new HashSet<Vote>(); | |
private readonly ISet<Commentary> _comments = new HashSet<Commentary>(); | |
private readonly ISet<Relevancy> _relevancies = new HashSet<Relevancy>(); | |
protected Story() | |
{ } | |
public virtual Relevancy Relate(Story story, User contributor, RelevancyScore score) |
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
public partial class AwesomeSauceForm : Form | |
{ | |
private Task _theTaskAtHand; | |
public AwesomeSauceForm() | |
{ | |
InitializeComponent(); | |
Task.Factory.StartNew(() => | |
{ |
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
CREATE TABLE [dbo].[Directories] | |
( | |
[AggregateId] UNIQUEIDENTIFIER NOT NULL, | |
[Name] NVARCHAR(64) NOT NULL, | |
[Route] NVARCHAR(128) NOT NULL UNIQUE, | |
[Route_Hash] AS CAST(HASHBYTES('SHA1', [Route]) AS VARBINARY(20)) PERSISTED UNIQUE, | |
[Depth] TINYINT NOT NULL, | |
[ParentId] UNIQUEIDENTIFIER NULL, | |
CONSTRAINT [PK_Directories] PRIMARY KEY NONCLUSTERED ( | |
[AggregateId] ASC |
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
/// <summary> | |
/// Keep in mind - factories are doing most object construction. | |
/// Trying to keep the idea simple to cut to the point... | |
/// </summary> | |
// when creating a client, we need the primary user (eg. account holder) | |
// the primary user may be created at the same point in time as the client, or be an existing user of any service | |
var client = new Client(Guid.NewCombGuid(), "Client Name", user); | |
// when creating a review on some entity in service ABC, assuming "entity" is present in context from some repository |
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
As an anonymous user, I can register in the network. | |
As a registered user, I can login to any service | |
As a registered user, I have global permissions, as well as permissions per service | |
As a registered user, I can become a client | |
As a client, I can register employees - who in turn, I assign global permissions, as well as permissions per service | |
... | |
service-abc.com ] |
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
CREATE TABLE [dbo].[Accounts_Users]( | |
[Id] [uniqueidentifier] NOT NULL, | |
[AccountId] [uniqueidentifier] NOT NULL, | |
[UserId] [uniqueidentifier] NOT NULL, | |
CONSTRAINT [PK_Accounts_Users] PRIMARY KEY CLUSTERED ([Id] ASC) | |
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY] | |
NewerOlder