public Thread(Generator generator, Action action) : base(generator, typeof(IThread)) { inner = (IThread)Handler; this.action = action; inner.Create(); }
public Thread(Action action, Generator generator = null) : base(generator, typeof(IThread), false) { this.action = action; Handler.Create(); Initialize(); }
public async Task <IActionResult> AddThread(int albumId, Thread model, IFormFile file, string tags) { //the type of files that the system ONLY accepts if (file.ContentType == "image/jpeg" || file.ContentType == "image/png") { var userId = _userManager.GetUserId(User); //gets the usersId var user = await _userManager.FindByIdAsync(userId); //gets the userName var thread = _service.Create(model, user, albumId); //creates the thread _service.ChangeTags(thread.Result, tags); var threadId = thread.Result.ID; //gets the Threads id await _service.AssignCords(file, threadId); //assignes the cords from the picture await UploadThreadImage(file, threadId); //uploads the threadImage return(RedirectToAction("Index", "Thread", new { @id = threadId })); //shows the thread that was created } return(View("../Shared/Error")); }