re-fixes the command creation
A pro now may have specified several activities; Since, the query creation was broken
This commit is contained in:
@ -91,19 +91,23 @@ namespace Yavsc.Controllers
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public IActionResult Create(string id)
|
||||
public IActionResult Create(string id, string activityCode)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(id))
|
||||
throw new InvalidOperationException(
|
||||
"This method needs a performer id"
|
||||
);
|
||||
if (string.IsNullOrWhiteSpace(activityCode))
|
||||
throw new InvalidOperationException(
|
||||
"This method needs an activity code"
|
||||
);
|
||||
var pro = _context.Performers.Include(
|
||||
x => x.Performer).FirstOrDefault(
|
||||
x => x.PerformerId == id
|
||||
);
|
||||
if (pro == null)
|
||||
return HttpNotFound();
|
||||
|
||||
ViewBag.Activity = _context.Activities.FirstOrDefault(a=>a.Code == activityCode);
|
||||
ViewBag.GoogleSettings = _googleSettings;
|
||||
var userid = User.GetUserId();
|
||||
var user = _userManager.FindByIdAsync(userid).Result;
|
||||
|
Reference in New Issue
Block a user