コード例 #1
0
        public ContentResult Send(Context context, string reference, long id)
        {
            var log    = new SysLogModel(context: context);
            var result = context.Authenticated
                ? OutgoingMailUtilities.SendByApi(
                context: context,
                reference: reference,
                id: id)
                : ApiResults.Unauthorized(context: context);

            log.Finish(context: context, responseSize: result.Content.Length);
            return(result);
        }
コード例 #2
0
        public async Task <HttpResponseMessage> Send(string reference, long id)
        {
            var body = await Request.Content.ReadAsStringAsync();

            var context = new Context(
                sessionStatus: User?.Identity?.IsAuthenticated == true,
                sessionData: User?.Identity?.IsAuthenticated == true,
                apiRequestBody: body);
            var log    = new SysLogModel(context: context);
            var result = context.Authenticated
                ? OutgoingMailUtilities.SendByApi(
                context: context,
                reference: reference,
                id: id)
                : ApiResults.Unauthorized(context: context);

            log.Finish(context: context, responseSize: result.Content.Length);
            return(result.ToHttpResponse(Request));
        }