Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced HistoryEntities (DB First) with HistoryContext (EF Code first)
Status Logging should be toggleable with settings window option (Instead of only before logging in) Deleted History.sdf because EF code first generates it automatically the first time.
- Loading branch information
Showing
47 changed files
with
37,512 additions
and
1,250 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,26 @@ | ||
<?xml version="1.0"?> | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<configSections> | ||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> | ||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> | ||
</configSections> | ||
<connectionStrings> | ||
<add name="HistoryEntities" connectionString="metadata=res://*/DAL.HistoryEntities.csdl|res://*/DAL.HistoryEntities.ssdl|res://*/DAL.HistoryEntities.msl;provider=System.Data.SqlServerCe.4.0;provider connection string="Data Source=|DataDirectory|\History.sdf"" providerName="System.Data.EntityClient"/> | ||
<add name="HistoryContext" connectionString="Data Source=|DataDirectory|\History.sdf" providerName="System.Data.SqlServerCe.4.0" /> | ||
</connectionStrings> | ||
<system.data> | ||
<DbProviderFactories> | ||
<remove invariant="System.Data.SqlServerCe.4.0"/> | ||
<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/> | ||
<remove invariant="System.Data.SqlServerCe.4.0" /> | ||
<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> | ||
</DbProviderFactories> | ||
</system.data> | ||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> | ||
</startup> | ||
<entityFramework> | ||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework"> | ||
<parameters> | ||
<parameter value="System.Data.SqlServerCe.4.0" /> | ||
</parameters> | ||
</defaultConnectionFactory> | ||
</entityFramework> | ||
</configuration> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace Squiggle.History.DAL.Entities | ||
{ | ||
public class Event | ||
{ | ||
public Guid Id { get; set; } | ||
public Guid SessionId { get; set; } | ||
public int TypeCode { get; set; } | ||
public Guid SenderId { get; set; } | ||
public string SenderName { get; set; } | ||
public string Data { get; set; } | ||
public DateTime Stamp { get; set; } | ||
|
||
[NotMapped] | ||
public EventType Type | ||
{ | ||
get { return (EventType)TypeCode; } | ||
set { TypeCode = (int)value; } | ||
} | ||
|
||
public Session Session { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Squiggle.History.DAL.Entities | ||
{ | ||
public enum EventType: int | ||
{ | ||
Message = 0, | ||
Buzz = 1, | ||
Joined = 2, | ||
Left = 3, | ||
Activity = 4 | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Data.Entity; | ||
|
||
namespace Squiggle.History.DAL.Entities | ||
{ | ||
class HistoryContext : DbContext | ||
{ | ||
public DbSet<Participant> Participants { get; set; } | ||
public DbSet<Session> Sessions { get; set; } | ||
public DbSet<Event> Events { get; set; } | ||
public DbSet<StatusUpdate> StatusUpdates { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Squiggle.History.DAL.Entities | ||
{ | ||
public class Participant | ||
{ | ||
public Guid Id {get; set;} | ||
public Guid SessionId { get; set; } | ||
public Guid ContactId { get; set; } | ||
public string ContactName { get; set; } | ||
|
||
public Session Session {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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Collections.ObjectModel; | ||
|
||
namespace Squiggle.History.DAL.Entities | ||
{ | ||
public class Session | ||
{ | ||
public Guid Id { get; set; } | ||
public Guid ContactId { get; set; } | ||
public string ContactName { get; set; } | ||
public DateTime Start { get; set; } | ||
public DateTime? End { get; set; } | ||
|
||
public ICollection<Event> Events { get; set; } | ||
public ICollection<Participant> Participants { get; set; } | ||
|
||
public Session() | ||
{ | ||
Events = new Collection<Event>(); | ||
Participants = new Collection<Participant>(); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Squiggle.History.DAL.Entities | ||
{ | ||
public class StatusUpdate | ||
{ | ||
public Guid Id { get; set; } | ||
public Guid ContactId { get; set; } | ||
public string ContactName { get; set; } | ||
public int StatusCode { get; set; } | ||
public DateTime Stamp { get; set; } | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.