<commit_before>﻿using System.Web.Http.Controllers;
using System.Web.Http.Filters;
using SFA.DAS.EAS.Infrastructure.Data;
using WebApi.StructureMap;

namespace SFA.DAS.EAS.Account.Api.Filters
{
    public class UnitOfWorkManagerFilter : ActionFilterAttribute
    {
        public override void OnActionExecuting(HttpActionContext actionContext)
        {
            actionContext.GetService<IUnitOfWorkManager>().Begin();
        }

        public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
            actionExecutedContext.GetService<IUnitOfWorkManager>().End(actionExecutedContext.Exception);<commit_msg>Fixed a bug where multiple instances of the unit of work manager would be resolved per request<commit_after>﻿using System.Web.Http.Controllers;
using System.Web.Http.Filters;
using SFA.DAS.EAS.Infrastructure.Data;
using WebApi.StructureMap;

namespace SFA.DAS.EAS.Account.Api.Filters
{
    public class UnitOfWorkManagerFilter : ActionFilterAttribute
    {
        public override void OnActionExecuting(HttpActionContext actionContext)
        {
            actionContext.Request.GetService<IUnitOfWorkManager>().Begin();
        }

        public override void OnActionExecuted(HttpActionExecutedContext actionExecutedContext)
        {
            actionExecutedContext.Request.GetService<IUnitOfWorkManager>().End(actionExecutedContext.Exception);
{'fraction_non_alphanumeric': 0.07686832740213523, 'fraction_numerical': 0.0, 'mean_word_length': 4.1881918819188195, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7245502', 'n_tokens_mistral': 375, 'n_tokens_neox': 378, 'n_words': 67}