1

I am trying to fake DbFunctions.DiffDays but am encountering some difficulty. The signatures seem to match but I am still getting

"The type or namespace name 'Fakes' does not exist in the namespace 'System.Data.Entity'"

My code is as follows:

System.Data.Entity.Fakes.ShimDbFunctions.DiffDaysNullableOfDateTimeNullableOfDateTime = 
    (DateTime? d1, DateTime? d2) =>
    {
        var timespan = d1.Value - d2.Value;
        return (int?)Convert.ToInt32(timespan.TotalDays);
    };

Has anyone encountered this before?

gwoody1984
  • 315
  • 3
  • 16

1 Answers1

0

I found an answer in : Moq and DbFunctions

Basically you need to add Fakes to EntityFramework.

Community
  • 1
  • 1
Igoris Azanovas
  • 1,640
  • 1
  • 22
  • 37