public IList <TransferScript> Get() { var identity = (FormsIdentity)HttpContext.Current.User.Identity; var operatorId = _cookieParser.GetUserId(identity); return(_scriptService.FetchScriptsByOperatorId(operatorId) .Select(script => _scriptMapper.Map(script)) .ToList()); }
public TransferScript Post() { var fileStream = GetFileStream(); Script script = _presentationParser.Parse(fileStream); var identity = (FormsIdentity)HttpContext.Current.User.Identity; script.OperatorId = _cookieParser.GetUserId(identity); script.Title = GetFileName(); _scriptService.SaveScript(script); return(_scriptMapper.Map(script)); }