Partial Methods Entity Framework

94 views Asked by At

I am trying to implement partial methods with Entity Framework Code first

using System;
using System.Collections.Generic;

namespace CodeFirstPortalEntity.Models
{
    public partial class ActionItem
{
    public long Id { get; set; }
    public string Title { get; set; }
    public string Description { get; set; }
    public bool Completed { get; set; }

}
}

All i want to do is execute some code when the "Completed " field is changed

I have been trying to do something like this

 partial class ActionItem
{
    partial void OnCompletedChanging(bool value)
    {
        if(value==true)
           {....Do Stuff.....}

    }
}

No matter what i do i keep getting

Error 1 No defining declaration found for implementing declaration of partial method 'CodeFirstPortalEntity.Models.Opportunity.OnCompletedChanging(bool)'

I have been reading non stop and have yet to find a solution. Please help.

0

There are 0 answers