Search This Blog

Friday, May 20, 2016

Dynamics CRM 2011 feature

The below items were introduced in CRM 2011 as compared to previous version 4.0

  • Assigning records to teams
  • Adding related items grids to forms(now it is configuration)
  • Lookup fields(easy creation)
  • Dashboards(Wizard based erport creation is available)
  • Share-point 2010 integration
  • Auditing(configure auditing for an entity down to the attribute level)
  • Role based forms
  • Global optionsets are available we can use more than one form

Thursday, May 12, 2016

Customize CRM Charts-Part2


There are  two axes: 
  • horizontal (x) and 
  • vertical (y).
x axis is called the "category axis" (can display numeric as well as non-numeric values)
y axis is called the "series axis".(can display numeric as well as non-numeric values).

Series 

  • Single-series charts: Charts that display data with a series (y) value mapped to a category (x) value.
  • Multi-series charts: Charts that display data with multiple series values mapped to a single category value. Multi-series charts include stacked column charts, which vertically display the contribution of each series to a total across categories, and 100% stacked column charts, which compare the percentage that each series contributes to a total across categories. You can combine different compatible chart types in multi-series charts, for example, column and line, bar and line, and so on.
Category

1) Data about general information regarding the chart: the GUID of the chart, the name of the chart and the entity it is related to
2) The determines which fields will be used in the chart. Use this section pull information from related entities. Use this section change how the information is being aggregated
3) The determines the category and series information.

4) contains data about how each data series is being displayed. Customize the type of chart (see Additional Information for list of chart types) i. Make sure that your chart type is supported by the data ii. Each chart type has specific attributes that should be followed. Customize how the chart is displayed: color, font, size . . .
5) controls how the x-axis and y-axis are displayed a. The syntax for this section will change based on the chart type
6) determines how the relevant information about the chart will be displayed By understanding the key areas of the XML for charts, it allows you to create charts that managers and executives can more easily consume.

Create Email Activity in CRM Plugin


public void Execute(IServiceProvider serviceProvider)
        {
            try
            {
                IPluginExecutionContext context =
                   (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));


                // Get a reference to the Organization service.
                IOrganizationServiceFactory factory =                    (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));

                IOrganizationService service = factory.CreateOrganizationService(context.UserId);
             
 if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
                {
                    Entity objDetailDTO = (Entity)context.InputParameters["Target"];

                    ActivityParty fromUser = new ActivityParty
                    {
                        PartyId = new EntityReference(SystemUser.EntityLogicalName, objDetailDTO.Attributes["systemuserid"])
                    };

                    Email email = new Email();
                    email.From = new ActivityParty[] { fromUser };

                    email.To = new ActivityParty[] { /*Whom you want to send email(activityparty)*/ };

                    //email.Bcc = ccUsers.ToArray();

                    email.Subject = "subject";

                    email.Description = "body";

                    //Assign regarding    
                    email.RegardingObjectId = new EntityReference(objDetailDTO.Attributes["contactid"]);
                   
                    Guid emailGUID = service.Create(email);
                }
            }
            catch (FaultException<OrganizationServiceFault> ex)
            {
                if (ex != null)
                    throw new InvalidPluginExecutionException(string.Format("An error occurred : {0}", 
ex.Message), ex);

            }
        }

CRM Entity GUID in SSRS

= Parameters!CRM_URL.Value + "/tools/audit/audit_details.aspx?_CreateFromId=&_CreateFromType=2 &id={" & CType(Fields!contactid.Value, GUID).ToString & "}"

Database cannot be started in this edition of SQL Server because it contains a partition function 'AuditPFN'


Today I faced this problem when trying to restore a Dynamics CRM  database from a SQL Server  Enterprise Edition to a SQL Server  Developer Edition or Standard edition.

It got me crazy as I did not created any partition on the original DB and this problem didn’t allow to me to restore the DB

Cause:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

Database 'Org_MSCRM' cannot be started in this edition of SQL Server because it contains a partition function 'AuditPFN'. Only Enterprise edition of SQL Server supports partitioning. Database 'Org_MSCRM' cannot be started because some of the database functionality is not available in the current edition of SQL Server.

Solution:
IF EXISTS (SELECT name FROM sys.partition_schemes WHERE name='AuditPScheme')
BEGIN
SELECT
  CASE WHEN ind.type != 1
   THEN
    'DROP INDEX [dbo].[AuditBase].' + QUOTENAME(ind.name) + ' '
   ELSE ' '
  END +
  'CREATE ' + CASE is_unique WHEN 1 THEN 'UNIQUE ' ELSE '' END  +
  ind.type_desc + ' INDEX ' + QUOTENAME(ind.name  COLLATE SQL_Latin1_General_CP1_CI_AS )  + ' ON [dbo].' +  QUOTENAME(OBJECT_NAME(object_id)) + ' (' +
 
  REVERSE(SUBSTRING(REVERSE((
   SELECT name + CASE WHEN sc.is_descending_key = 1 THEN ' DESC' ELSE ' ASC' END + ','
   FROM
    sys.index_columns sc
    JOIN sys.columns c ON sc.object_id = c.object_id AND sc.column_id = c.column_id
   WHERE
    OBJECT_NAME(sc.object_id) = 'AuditBase' AND
    sc.object_id = ind.object_id AND
    sc.index_id = ind.index_id
   ORDER BY index_column_id ASC
   FOR XML PATH('')
        )), 2, 8000)) + ')' +
  CASE WHEN ind.type = 1
   THEN
    ' WITH (DROP_EXISTING = ON) ON [PRIMARY]'
   ELSE
    ' '
  END  as Script
INTO #indexesScript
FROM sys.indexes ind
JOIN sys.partition_schemes ps on ind.data_space_id=ps.data_space_id
WHERE
  OBJECT_NAME(object_id) = 'AuditBase'
  AND ps.name = 'AuditPScheme'
  AND is_unique_constraint = 0
SELECT * FROM #indexesScript
 
DECLARE @recreateScript nvarchar(max)
DECLARE indScript CURSOR FOR
SELECT Script FROM #indexesScript
OPEN indScript
FETCH NEXT FROM indScript INTO @recreateScript
 
WHILE @@FETCH_STATUS = 0  
BEGIN  
  BEGIN TRANSACTION t1
  Execute sp_executesql @recreateScript
 
  IF @@ERROR > 0
  BEGIN
   ROLLBACK TRAN t1
   declare @message varchar(max)
   set @message = 'Audit history recreate index failed. SQL: ' + @recreateScript
      RAISERROR (@message, 10,1)
  END
  ELSE
  BEGIN
   COMMIT TRAN
  END
  FETCH NEXT FROM indScript INTO @recreateScript  
END  
DROP PARTITION SCHEME AuditPScheme
DROP PARTITION FUNCTION AuditPFN
 
CLOSE indScript  
DEALLOCATE indScript
DROP TABLE #indexesScript
END

Operator '+' is not defined for string SSRS

In the concatenation expression, one of the item value is not string. You have to convert to string and concatenate it.

Object address not found on party or party is marked as non-emailable

Usually this error occur when you want to send mail to Account or Contact or User from workflow or plugin


 Account or Contact

  • Check DonotEmail or DonotBulkemail is must set to "allow"


User 
You have to check the primary email field is filled in the user entity.

Dynamics CRM 2013 Microsoft.Crm.Reporting.RdlHelper error when attempting to preview a CRM report within SQL Data Tools

If you have setup your CRM 2013 Report Authoring Environment using the SQL Data Tools (Visual Studio 2010) and the CRM 2013 Report Authoring Extensions – when modifying Out of Box CRM Reports or Reports created by the CRM Report Wizard, you may encounter the following error when attempting to preview within the SQL Data Tools:

Error while loading code module: ‘Microsoft.Crm.Reporting.RdlHelper, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. Details: Could not load file or assembly ‘Microsoft.Crm.Reporting.RdlHelper, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 or one of its dependencies.

The most common reason for this error is that the report is referencing version 5.0.0.0 of Microsoft.Crm.Reporting.RdlHelper and your Report Authoring Environment actually utilises version 6.0.0.0

To overcome this issue, you can simply do the following:

Make sure your focus is on the Report Layout

  • Go to the Report menu on the toolbar and select Report Properties 

  • Select the References section and there you should see the reference to Microsoft.Crm.Reporting.RdlHelper 
  • Edit the version number to be 6.0.0.0 (instead of 5.0.0.0) 

  • Press OK

Thursday, May 5, 2016

Pre-Filtering in CRM

CRM Pre-Filtering is a very useful option that can be enabled on CRM reports to make them context sensitive and to allow the report to be filtered using the Advanced Find functionality.  Although this is a great feature, it is often an area that is not fully understood which can lead to someone encountering unexpected results.

There are 2 ways to enable the CRM Pre-Filtering functionality. The easiest option is the CRMAF_ method which simply requires aliasing the filtered views with a name that starts with “CRMAF_”.   A query such as “Select name from FilteredAccount” can simply be changed to “Select name from FilteredAccount as CRMAF_Account”.  Aliasing the Filtered View with a prefix of CRMAF_ will allow CRM to recognize that you would like to enable this entity for pre-filtering.
When you enable the CRM Pre-filtering functionality using the CRMAF_ method, CRM will take a query such as the following and modify it when it is uploaded into CRM:
SELECT name, accountnumber 
FROM FilteredAccount as CRMAF_Account



Which . net version installed in PC or computer


To find .NET Framework versions by viewing the registry (.NET Framework 1-4)

  1. On the Start menu, choose Run.
  2. In the Open box, enter regedit.exe.
    You must have administrative credentials to run regedit.exe.
  3. In the Registry Editor, open the following subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP
    The installed versions are listed under the NDP subkey. The version number is stored in the Version entry. For the .NET Framework 4 the Versionentry is under the Client or Full subkey (under NDP), or under both subkeys.

To find .NET Framework versions by viewing the registry (.NET Framework 4.5 and later)

  1. On the Start menu, choose Run.
  2. In the Open box, enter regedit.exe.
    You must have administrative credentials to run regedit.exe.
  3. In the Registry Editor, open the following subkey:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full
    Note that the path to the Full subkey includes the subkey Net Framework rather than .NET Framework.
If the Full subkey is not present, then you do not have the .NET Framework 4.5 or later installed.


Value of the Release DWORD
Version
378389
.NET Framework 4.5
378675
.NET Framework 4.5.1 installed with Windows 8.1 or Windows Server 2012 R2
378758
.NET Framework 4.5.1 installed on Windows 8, Windows 7 SP1, or Windows Vista SP2
379893
.NET Framework 4.5.2
On Windows 10 systems: 393295
On all other OS versions: 393297
.NET Framework 4.6
On Windows 10 November Update systems: 394254
On all other OS versions: 394271
.NET Framework 4.6.1
On Windows 10 Insider Preview Build 14295: 394747
On all other OS versions: 394748
.NET Framework 4.6.2 Preview

Tuesday, May 3, 2016

CRM new or customized report not showing in the solution

If you create/add custom report in CRM by default it will display as "individual" not other user can display the report.
So it will not able to add in the solution if the report is as "individual" . If it changed to "organization" it will display in the solution

After  it changed to "organization" it will display in the solution.






Entity frame work Generic Base controller

 public class BaseController<T,E,R> : ApiController, ICRUD<E> where T : class
        where E:class
        where R : class
   
    {
        #region ExtensionMethod
        public virtual object UpdateAllExtension(RequestDTO objParamData)
        {
            return null;
        }

        public virtual object DeleteAllExtension(object objParamData)
        {
            return null;
        }

        public virtual object CreateAllExtension(RequestDTO objParamData)
        {
            return null;
        }
        #endregion


        #region Protected Methods

        #region ResponseData
        /// <summary>
        /// Transforming result in to the client acceptable DTO format.  
        /// </summary>
        /// <param name="objParamResult">object instance...</param>
        /// <returns>ResponseModel instance...</returns>
        protected object ResponseData(object objParamResult)
        {
            if (null == objParamResult)
                return Request.CreateErrorResponse(HttpStatusCode.NotFound, "NODATA");
            else if (objParamResult is Exception)
            {
                if (objParamResult is UnauthorizedAccessException)
                {
                    return Request.CreateErrorResponse(HttpStatusCode.Unauthorized, ((Exception)objParamResult).Message, (Exception)objParamResult);
                }
                //else if (objParamResult is System.ServiceModel.CommunicationException)
                //{
                //    if (((Exception)objParamResult).InnerException != null && ((Exception)objParamResult).InnerException.Message == "The remote server returned an error: (401) Unauthorized.")
                //        return Request.CreateErrorResponse(HttpStatusCode.Unauthorized, "Invalid credentials", (Exception)objParamResult);
                //    else
                //        Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, ((Exception)objParamResult).Message, (Exception)objParamResult);

                //}
                return Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, ((Exception)objParamResult).Message, (Exception)objParamResult);
            }
            ResponseModel objResponseModelDTO = new ResponseModel();
            objResponseModelDTO.data = objParamResult;
            return objResponseModelDTO;
        }
        #endregion

        #endregion

        public Type objEntity = typeof(T);

        #region Create
        /// <summary>
        /// Create new record in the table
        /// </summary>
        /// <param name="objDTO">Table Model Entity</param>
        /// <returns>Response Model</returns>
        [HttpPost]
        public object Create(RequestDTO objRequestDTO)
        {
            Type objBusinessType = typeof(T);
            //GenericRepository<T> objGenericRepository = new GenericRepository<B>();
            object objBusinessInstance = Activator.CreateInstance(objBusinessType);

            E objDTO = (E)DeserializeObject(objRequestDTO.Entity);

            if (objDTO == null)
                return ResponseData("Entity value is null");

            Object objValue = objBusinessType.GetMethod("Insert").Invoke(objBusinessInstance, new object[] { objDTO });
            object obj3 = objBusinessType.GetMethod("SaveChanges").Invoke(objBusinessInstance, null);

            object objNewValue = CreateAllExtension(objRequestDTO);
           
            objValue = objNewValue == null ? objValue : objNewValue;
            return ResponseData(objValue);
        }
        #endregion

        #region Update
        /// <summary>
        /// Update a record in the table
        /// </summary>
        /// <param name="objDTO">Table Model Entity</param>
        /// <returns>Response Model</returns>
        [HttpPost]
        public object Update(RequestDTO objRequestDTO)
        {
            Type objBusinessType = typeof(T);
            // GenericRepository<T> objGenericRepository = new GenericRepository<B>();
            object objBusinessInstance = Activator.CreateInstance(objBusinessType);

            E objDTO = (E)DeserializeObject(objRequestDTO.Entity);

            if (objDTO == null)
                return ResponseData("Entity value is null");
           
            objBusinessType.GetMethod("Update").Invoke(objBusinessInstance, new object[] { objDTO });
            object objValue = objBusinessType.GetMethod("SaveChanges").Invoke(objBusinessInstance, null);

            object objNewValue = UpdateAllExtension(objRequestDTO);
            objValue = objNewValue == null ? objValue : objNewValue;

            return ResponseData(objValue);
        }
        #endregion

        [HttpGet]
        public object Delete(int iValue)
        {
            Type objBusinessType = typeof(T);
            // GenericRepository<T> objGenericRepository = new GenericRepository<B>();
            object objBusinessInstance = Activator.CreateInstance(objBusinessType);

            if (iValue == null)
                return ResponseData("Value is null");

            objBusinessType.GetMethod("Delete").Invoke(objBusinessInstance, new object[] { iValue });
            object objValue = objBusinessType.GetMethod("SaveChanges").Invoke(objBusinessInstance, null);

            object objNewValue = DeleteAllExtension(objValue);

            objValue = objNewValue == null ? objValue : objNewValue;
            return ResponseData(objValue);
        }

        [HttpGet]
        public object FindById(int objId)
         {
             //Type objBusinessType = typeof(T);
              GenericRepository<E> objGenericRepository = new GenericRepository<E>();
           
           //  object objBusinessInstance = Activator.CreateInstance(objBusinessType);

              object objValue = objGenericRepository.GetType().GetMethod("GetByID").Invoke(objGenericRepository, new object[] { objId });
//             object objValue = objBusinessType.GetMethod("GetByID").Invoke(objBusinessInstance, new object[] { objId });
            // objBusinessType.GetMethod("SaveChanges").Invoke(objBusinessInstance, null);
             return ResponseData(objValue);
         }

        [HttpPost]
        [Action1DebugActionWebApiFilter]
        public object FindAll(RequestDTO objRequestDTO)
        {
            Type objBusinessType = typeof(T);
         
            // GenericRepository<T> objGenericRepository = new GenericRepository<B>();
            object objBusinessInstance = Activator.CreateInstance(objBusinessType);

            List<Filter> filter = new List<Filter>
{
    new  Filter  { PropertyName = "Id" , Value = "10" ,Operation = Op .Equals, },
   
};
            if (objRequestDTO == null)
                objRequestDTO = new RequestDTO();
         //   objRequestDTO.Filter = filter;
            Expression<Func<E, bool>> delegFilter = null;
         //   delegFilter = ExpressionBuilder.GetExpression<E>(filter);
           delegFilter= ExpressionBuilder.GetExpression<E>(objRequestDTO.Filter);
           Func<IQueryable<E>, IOrderedQueryable<E>> delegOrder=null;



           //delegOrder = (Func<IQueryable<E>, IOrderedQueryable<E>>)GetOrderBy<UserDTO>("dUserId", "asc");
            if(!string.IsNullOrEmpty(objRequestDTO.strOrderColumn))
           delegOrder = (Func<IQueryable<E>, IOrderedQueryable<E>>)GetOrderBy<E>(objRequestDTO.strOrderColumn,objRequestDTO.strSortBy);

           // Expression<Func<UserDTO, bool>> deleg = ExpressionBuilder.GetOrderExpression<UserDTO>(order);

            object objValue = objBusinessType.GetMethod("Get").Invoke(objBusinessInstance, new object[] { delegFilter, delegOrder, "", objRequestDTO.offset, objRequestDTO.Max});
            // objBusinessType.GetMethod("SaveChanges").Invoke(objBusinessInstance, null);
 

            //List<Type> lst =new List<Type>();
            //lst.Add(typeof(SubTask));
            //lst.Add(typeof(CheckList));
            //lst.Add(typeof(Company));

            //System.Runtime.Serialization.DataContractSerializer dcs = new System.Runtime.Serialization.DataContractSerializer(typeof(Task), lst.AsEnumerable());
            //var serializer = new System.Runtime.Serialization.DataContractSerializer(typeof(Task), new System.Runtime.Serialization.DataContractSerializerSettings()
            //{
            //    DataContractResolver = new System.Data.Entity.Core.Objects.ProxyDataContractResolver()
            //});
            //var ms = new System.IO.MemoryStream();

            //serializer.WriteObject(ms, objValue);

            //ms.Seek(0, SeekOrigin.Begin);



            //var sr = new StreamReader(ms);

            //var xml = sr.ReadToEnd();
         
            return  ResponseData(objValue);
        }

        internal static object DeserializeObject(object objEntity)
        {
            string TempJson = Newtonsoft.Json.JsonConvert.SerializeObject(objEntity);
            Type objType = typeof(Newtonsoft.Json.JsonConvert);

            MethodInfo[] arrt = typeof(Newtonsoft.Json.JsonConvert).GetMethods();
            object objValue1 = arrt[40].MakeGenericMethod(typeof(E)).Invoke(null, new object[] { TempJson });
            return objValue1;
        }

        public object FindByOwnder(int objId)
        {
            throw new NotImplementedException();
        }

        public static Func<IQueryable<T>, IOrderedQueryable<T>> GetOrderBy<T>(string orderColumn, string orderType)
        {
            Type typeQueryable = typeof(IQueryable<T>);
            ParameterExpression argQueryable = Expression.Parameter(typeQueryable, "p");
            var outerExpression = Expression.Lambda(argQueryable, argQueryable);
            string[] props = orderColumn.Split('.');
            IQueryable<T> query = new List<T>().AsQueryable<T>();
            Type type = typeof(T);
            ParameterExpression arg = Expression.Parameter(type, "x");

            Expression expr = arg;
            foreach (string prop in props)
            {
                PropertyInfo pi = type.GetProperty(prop, BindingFlags.IgnoreCase | BindingFlags.Public | BindingFlags.Instance);
                expr = Expression.Property(expr, pi);
                type = pi.PropertyType;
            }
            expr = Expression.Property(arg, orderColumn);
            LambdaExpression lambda = Expression.Lambda(expr, arg);
            string methodName = orderType == "asc" ? "OrderBy" : "OrderByDescending";
           
            MethodCallExpression resultExp =
                Expression.Call(typeof(Queryable), methodName, new Type[] { typeof(T),type }, outerExpression.Body, Expression.Quote(lambda));
            var finalLambda = Expression.Lambda(resultExp, argQueryable);
            return (Func<IQueryable<T>, IOrderedQueryable<T>>)finalLambda.Compile();
        }
    }

    #region ExpressionBuilder
    public static class ExpressionBuilder
    {
        private static MethodInfo containsMethod = typeof(string).GetMethod("Contains");
        private static MethodInfo startsWithMethod =
        typeof(string).GetMethod("StartsWith", new Type[] { typeof(string) });
        private static MethodInfo endsWithMethod =
        typeof(string).GetMethod("EndsWith", new Type[] { typeof(string) });


        public static Expression<Func<T,
        bool>> GetExpression<T>(IList<Filter> filters)
        {
            if (filters == null)
                return null;

            if (filters.Count == 0)
                return null;

            ParameterExpression param = Expression.Parameter(typeof(T), "t");
            Expression exp = null;

            if (filters.Count == 1)
                exp = GetExpression<T>(param, filters[0]);
            else if (filters.Count == 2)
                exp = GetExpression<T>(param, filters[0], filters[1]);
            else
            {
                while (filters.Count > 0)
                {
                    var f1 = filters[0];
                    var f2 = filters[1];

                    if (exp == null)
                        exp = GetExpression<T>(param, filters[0], filters[1]);
                    else
                        exp = Expression.AndAlso(exp, GetExpression<T>(param, filters[0], filters[1]));

                    filters.Remove(f1);
                    filters.Remove(f2);

                    if (filters.Count == 1)
                    {
                        exp = Expression.AndAlso(exp, GetExpression<T>(param, filters[0]));
                        filters.RemoveAt(0);
                    }
                }
            }

            return Expression.Lambda<Func<T, bool>>(exp, param);
        }

        private static Expression GetExpression<T>(ParameterExpression param, Filter filter)
        {
            MemberExpression member = Expression.Property(param, filter.PropertyName);
            ConstantExpression constant = null;
            if (member.Type.Name == "Int32")
            {
                Int32 iValue = Convert.ToInt32(filter.Value);
                constant = Expression.Constant(iValue);
            }
            else if (member.Type.Name == "Int64")
            {
                Int64 iValue = Convert.ToInt64(filter.Value);
                constant = Expression.Constant(iValue);
            }
            else
                constant = Expression.Constant(filter.Value);

            switch (filter.Operation)
            {
                case Op.Equals:
                    return Expression.Equal(member, constant);

                case Op.NotEquals:
                    return Expression.NotEqual(member, constant);

                case Op.GreaterThan:
                    return Expression.GreaterThan(member, constant);

                case Op.GreaterThanOrEqual:
                    return Expression.GreaterThanOrEqual(member, constant);

                case Op.LessThan:
                    return Expression.LessThan(member, constant);

                case Op.LessThanOrEqual:
                    return Expression.LessThanOrEqual(member, constant);

                case Op.Contains:
                    return Expression.Call(member, containsMethod, constant);

                case Op.StartsWith:
                    return Expression.Call(member, startsWithMethod, constant);

                case Op.EndsWith:
                    return Expression.Call(member, endsWithMethod, constant);
            }

            return null;
        }

        private static BinaryExpression GetExpression<T>
        (ParameterExpression param, Filter filter1, Filter filter2)
        {
            Expression bin1 = GetExpression<T>(param, filter1);
            Expression bin2 = GetExpression<T>(param, filter2);

            return Expression.AndAlso(bin1, bin2);
        }



    }
    #endregion


    public class Action1DebugActionWebApiFilter : ActionFilterAttribute
    {
        public override void OnActionExecuting(HttpActionContext actionContext)
        {
            List<string> lstHeaderValue = actionContext.Request.Headers.GetValues("Authorization").ToList();
           
            if (lstHeaderValue == null)
                throw new Exception("");

         
        }

    }