public async Task <ActionResult> SetRouten([FromBody] RoutenModel value) { var authenticatedUser = BuildNRun.Helper.UserHelper.GetAuthenticatedUser(this.User); if (authenticatedUser is null) { return(new ForbidResult()); } else { var accountGrain = this._GrainFactory.GetGrain <IAccountGrain>(authenticatedUser); var account = await accountGrain.GetAccount(); var routenGrain = this._GrainFactory.GetGrain <IRoutenGrain>(account.UserId); await routenGrain.SetRouten(value); return(new OkResult()); } }
/// <summary> /// Constructor of RoutenViewModel /// </summary> /// <param name="geoCoding"></param> /// <param name="staticMaps"></param> public RoutenViewModel(IGeoCoding geoCoding, IStaticMaps staticMaps, IDirections directions) { this.geoCoding = geoCoding; this.staticMaps = staticMaps; this.directions = directions; OriginChanging = new EventOriginChanging(); OriginChanging.OriginChangingEvent += OnOriginChanging; DestinationChanging = new EventDestinationChanging(); DestinationChanging.DestinationChangingEvent += OnDesinationChanging; DisplayMapCommand = new DelegateCommand(DisplayMap, CanDisplayMap); DisplayDirectionsCommand = new DelegateCommand(DisplayDirections, CanDisplayDirections); ClearFieldsCommand = new DelegateCommand(ClearFields, CanClearFields); RoutenModel = new RoutenModel(OriginChanging, DestinationChanging) { Origin = "Breiteweg 17, 30, 06 Bern", Waypoint = "Ziegelfeldstrasse, 4600 Olten", Destination = "Zürich Flughafen, 8302 Kloten" }; }