This file contains hidden or 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 PetaPocoHierarchy.Models; | |
namespace PetaPocoHierarchy.Services | |
{ | |
/// <summary> | |
/// Set Organization Parent in the Organization Hierarchy | |
/// </summary> | |
/// <remarks> | |
/// Based on logic for mapping demo: http://www.toptensoftware.com/Articles/115/PetaPoco-Mapping-One-to-Many-and-Many-to-One-Relationships | |
/// </remarks> |
This file contains hidden or 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 System.Collections.Generic; | |
using PetaPocoHierarchy.Models; | |
namespace PetaPocoHierarchy.Services | |
{ | |
public class OrganizationRepository : Repository, IOrganizationRepository | |
{ | |
public IEnumerable<Organization> GetAll() | |
{ | |
// SELECT a row of data containing an Organization and Parent Organization |
This file contains hidden or 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 System; | |
using System.Linq; | |
using System.Collections.Generic; | |
using PetaPoco; | |
namespace PetaPocoHierarchy.Models | |
{ | |
public class Organization | |
{ | |
public Guid Id { get; set; } |
This file contains hidden or 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
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
CREATE TABLE [dbo].[Organization]( | |
[Id] [uniqueidentifier] NOT NULL, | |
[ParentId] [uniqueidentifier] NULL, | |
[OrganizationCode] [nvarchar](10) NOT NULL, |
This file contains hidden or 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 System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using NUnit.Framework; | |
namespace StackOverflowQuestionsTests | |
{ | |
[TestFixture] | |
class LinqExamples |
This file contains hidden or 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 System; | |
using System.Collections.Generic; | |
namespace WoodConsultingPractice | |
{ | |
public interface IToddWood | |
{ | |
IEnumerable<Result> Work<T>(T challenge); | |
IEnumerable<Memory> Life(Action action); | |
Post Blog<T>(Result knowledge, Memory experience, T content); |
NewerOlder