CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

The type initializer for 'ProjectTracker.DalMock.MockDb' threw an exception.

rated by 0 users
Not Answered This post has 0 verified answers | 0 Replies | 1 Follower

Not Ranked
3 Posts
gbetz posted on Wed, Apr 4 2012 2:38 PM

trying to use MockDb. here is the code:

 

 

 

 

 

 

 

public List<ProjectDto

> Fetch()

{

 

 

 

var result = from r in ProjectTracker.DalMock.MockDb

.Projects

 

 

 

select new

ProjectDto

{

Id = r.Id,

Name = r.Name,

Description = r.Description,

ParentID = r.ParentID,

Alias = r.Alias,

CapitalizationStage = r.CapitalizationStage,

Viability = r.Viability

};

 For some reason ProjectTracker.DalMock.MockDb.Projects throws the exception even though static constructor creates the list like so:

Projects = 

 

 

};

what is wrong here?

 

new List<ProjectData> { new ProjectData { Id = 1, Name = "Update ProjectTracker", Description = "Update ProjectTracker for CSLA 4", Started = new DateTime(2011, 3, 22), LastChanged = GetTimeStamp(),Alias = "blah", CapitalizationStage ="One", Viability = true, ParentID = 1 }

Page 1 of 1 (1 items) | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems