diff --git a/Yavsc/Models/Messaging/EstimationEvent.cs b/Yavsc.Server/Models/Messaging/EstimationEvent.cs similarity index 73% rename from Yavsc/Models/Messaging/EstimationEvent.cs rename to Yavsc.Server/Models/Messaging/EstimationEvent.cs index b846df34..79d4f781 100644 --- a/Yavsc/Models/Messaging/EstimationEvent.cs +++ b/Yavsc.Server/Models/Messaging/EstimationEvent.cs @@ -11,16 +11,12 @@ namespace Yavsc.Models.Messaging public class EstimationEvent: IEvent { - public EstimationEvent(ApplicationDbContext context, Estimate estimate, IStringLocalizer SR) + public EstimationEvent( Estimate estimate, IStringLocalizer SR) { Topic = "Estimation"; Estimation = estimate; - perfer = context.Performers.Include( - p=>p.Performer - ).FirstOrDefault( - p => p.PerformerId == estimate.OwnerId - ); - // Use estimate.OwnerId; + perfer = estimate.Owner; + ProviderInfo = new ProviderClientInfo { Rate = perfer.Rate, UserName = perfer.Performer.UserName, @@ -52,7 +48,7 @@ namespace Yavsc.Models.Messaging public string CreateBody() { - return string.Format(_localizer["EstimationMessageToClient"], perfer.Performer.UserName, this.Estimation.Bill.Addition()); + return string.Format( _localizer["EstimationMessageToClient"], perfer.Performer.UserName, this.Estimation.Bill.Addition()); } } } diff --git a/Yavsc/ApiControllers/BillingController.cs b/Yavsc/ApiControllers/BillingController.cs index e2e81c7b..a4bca8f3 100644 --- a/Yavsc/ApiControllers/BillingController.cs +++ b/Yavsc/ApiControllers/BillingController.cs @@ -125,7 +125,7 @@ namespace Yavsc.ApiControllers // Notify the client var locstr = _localizer["EstimationMessageToClient"]; - var yaev = new EstimationEvent(dbContext,estimate,_localizer); + var yaev = new EstimationEvent(estimate,_localizer); var regids = estimate.Client.Devices.Select(d => d.GCMRegistrationId).ToArray(); bool gcmSent = false; diff --git a/Yavsc/Models/Access/Rule.cs b/Yavsc/Models/Access/Rule.cs index 1fb9aca0..a4c69647 100644 --- a/Yavsc/Models/Access/Rule.cs +++ b/Yavsc/Models/Access/Rule.cs @@ -9,6 +9,6 @@ namespace Yavsc.Models.Access } // Abstract method to compute any authorization on a resource - public abstract bool Allow(ApplicationDbContext context, string userId, TResource resource, TRequirement requirement); + public abstract bool Allow(string userId, TResource resource, TRequirement requirement); } } diff --git a/Yavsc/Models/Access/RuleSet.cs b/Yavsc/Models/Access/RuleSet.cs index dc999bf1..c8b3068d 100644 --- a/Yavsc/Models/Access/RuleSet.cs +++ b/Yavsc/Models/Access/RuleSet.cs @@ -4,7 +4,7 @@ namespace Yavsc.Models.Access { public abstract class RuleSet :List> { - public abstract bool Allow(ApplicationDbContext context, string userId, TResource resource, TRequirement requirement); + public abstract bool Allow(string userId, TResource resource, TRequirement requirement); } } \ No newline at end of file diff --git a/Yavsc/Yavsc.nuspec b/Yavsc/Yavsc.nuspec index 5b4cd7a6..5a2e69aa 100644 --- a/Yavsc/Yavsc.nuspec +++ b/Yavsc/Yavsc.nuspec @@ -19,7 +19,7 @@ - + diff --git a/rc-num.txt b/rc-num.txt index 2d57e103..75a0af6f 100644 --- a/rc-num.txt +++ b/rc-num.txt @@ -1,2 +1 @@ -20-alpha2 - +20-alpha3 \ No newline at end of file