标签: enterprise-library

Jira使用OfBiz的企业架构

"开放的商业项目"是一个企业框架.

事实上Jira使用了这个,我对为特定实体提取数据涉及多少工作感到震惊(比如Jira案例中的问题/错误).

想象一下,获取所有问题的列表,它必须首先获取要为表列显示的所有列(或属性),然后为每个列提取值.对于企业解决方案,这听起来像是次优解决方案(但我理解它如何增加灵活性).

您几乎可以阅读它在Jira中的使用方式:http://confluence.atlassian.com/display/JIRA/Database+Schema

主要网站:http://ofbiz.apache.org/docs/entity.html

我只是对如何列出所有问题感到困惑.意思是,sql查询会是什么样子?

拉一个问题是一回事,但要获得一个清单,你必须做大量的工作来获得价值. 我认为现在可以使用连接使用单一查询来完成它吗?

entity-framework enterprise-library jira ofbiz

3
推荐指数
1
解决办法
3646
查看次数

验证应用程序块和.NET 4.0代码约定

有没有人在.NET 4.0中实现企业库VAB和代码合同?

如果是这样,你能分享一些见解吗?它对性能有帮助吗?还需要考虑其他因素吗?

.net validation enterprise-library .net-4.0 validationframework

3
推荐指数
1
解决办法
546
查看次数

Simple Enterprise Library控制台应用程序拒绝编译

我刚刚下载并安装了Microsoft Enterprise Library 5.0.我启动了VS 2010以使用EL 5并创建了一个非常简单的控制台应用程序.但是,它不会编译.我收到以下错误:

命名空间"Microsoft.Practices.EnterpriseLibrary"中不存在类型或命名空间名称"Data"(您是否缺少程序集引用?)

我添加了Microsoft.Practices.EnterpriseLibrary.Common,Microsoft.Practices.EnterpriseLibrary.DataMicrosoft.Practices.Unity 对我的项目的引用.

这是拒绝编译的简单代码.

using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Unity;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.Unity;

namespace EntLib
{
    class Program
    {
        static void Main(string[] args)
        {
            IUnityContainer container = new UnityContainer();
            container.AddNewExtension<EnterpriseLibraryCoreExtension>();
            var defaultDatabase = container.Resolve<Database>();
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

上面的错误抱怨第2行:

using Microsoft.Practices.EnterpriseLibrary.Data;
Run Code Online (Sandbox Code Playgroud)

有人可能会指出我犯了一个愚蠢的错误,但此刻我没有看到它.

我试图删除并再次添加Microsoft.Practices.EnterpriseLibrary.Data以重新启用,但它没有帮助.

.net c# enterprise-library enterprise-library-5

3
推荐指数
1
解决办法
6675
查看次数

更改企业库异常处理格式化程序中的时间戳值

我正在使用带有c#的enterprize库5.0进行异常处理,并且我正在使用formatter.Now在我的日志文件中,Timestamp没有给出正确的时间.我可以在格式化程序中更改时间戳的值.

timestamp enterprise-library exception-handling exception enterprise-library-5

3
推荐指数
1
解决办法
3891
查看次数

NLog到企业库

使用下面使用NLog的代码段如何使用Enterprise Library 5.0 Logging完成?

    private Logger _logger;
    public NLogger() {            
        _logger = LogManager.GetCurrentClassLogger();
    }

    public void Info(string message) {
        _logger.Info(message);
    }

    public void Warn(string message) {
        _logger.Warn(message);
    }
Run Code Online (Sandbox Code Playgroud)

c# enterprise-library nlog

3
推荐指数
1
解决办法
716
查看次数

使用一个日志应用程序块日志文件的多个进程

我们在ASP.NET 2.0应用程序中使用日志记录应用程序块,该应用程序块通过以下方式调用:

public class BaseLogEntry : LogEntry
{
    public void CloseLog()
    {
        try
        {
            Logger.Writer.Dispose();
        }
        catch (Exception)
        { }
    }
}

public class GeneralLogEntry : BaseLogEntry
{
    /// <summary>
    /// 
    /// </summary>
    /// <param name="message"></param>
    public GeneralLogEntry(string message) : this(message, 2) { }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="message"></param>
    /// <param name="priority"></param>
    public GeneralLogEntry(string message, int priority): base()
    {
        Categories.Add("General");
        Priority = priority;
        Severity = System.Diagnostics.TraceEventType.Information;
        Message = message;
        CloseLog();
    }
}
Run Code Online (Sandbox Code Playgroud)

当我们将IIS中的工作进程数增加到1以上时,日志文件会添加一个唯一的GUID,如下所示:

068aa49c-2bf6-4278-8f91-c6b65fd1ea3aApplication.log

应用程序生成的几个日志文件都是"Rolling Flat File …

iis enterprise-library asp.net-2.0 logging-application-block

3
推荐指数
1
解决办法
2176
查看次数

为什么我在调用ExceptionPolicy.HandleException时遇到System.InvalidOperationException?

我正在开发一个测试程序,帮助我弄清楚如何使用Microsoft.Practices.EnterpriseLibrary.ExceptionHandling框架.该程序定义了几种自定义异常类型,并将自定义异常处理程序与每种类型相关 在运行时,程序会提示用户输入异常类型,抛出异常,并使用ExceptionHandling框架为异常类型调用适当的异常处理程序:

using System;
using System.Collections.Specialized;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration;

namespace ConsoleApplication1
{
    public class AException  : Exception  { public AException(string message)  : base(message) { } }
    public class BException  : Exception  { public BException(string message)  : base(message) { } }
    public class BBException : BException { public BBException(string message) : base(message) { } }

    public class WrapperException : Exception
    {
        public WrapperException(Exception innerException)
            : base("Wrapped exception: [" + innerException.Message + "]", innerException) { }
    }

    public class …
Run Code Online (Sandbox Code Playgroud)

c# enterprise-library exception-handling exception

3
推荐指数
1
解决办法
6550
查看次数

将Dapper添加到企业库?

我们使用企业库作为标准DAL.现在,我想享受Dapper的好处.查看实现,它只是扩展连接类.

是否可以设置Dapper扩展企业库,以便我们可以享受这两个世界?或者有人已经创建了这个?

.net orm enterprise-library dapper

3
推荐指数
1
解决办法
1397
查看次数

如何关闭Microsoft.Practices.EnterpriseLibrary.Data.ExecuteNonQuery的连接

我正在使用库microsoft.practices.enterpriselibrary访问SQL Server数据库。我想知道使用ExecuteNonQuery方法时如何关闭连接?

即:

using Microsoft.Practices.EnterpriseLibrary.Data.Sql;

SqlDatabase db = null;
try
{
    db = new SqlDatabase(stringConnection);
    db.ExecuteNonQuery("storedprocedure", someParams);
}
catch (Exception ex)
{
}
Run Code Online (Sandbox Code Playgroud)

我不能做这样的事情

finally
{
    if (db != null)
    {
        ((IDisposable)db).Dispose();
    }
}
Run Code Online (Sandbox Code Playgroud)

那么...如何避免连接泄漏?

谢谢。

c# sql-server enterprise-library

3
推荐指数
2
解决办法
9841
查看次数

对事件ApplicationStarted使用未定义的关键字值0x1.在EnterpriseLibrary SLAB中

我正在使用Enterprise Library SLAB进行日志记录,但总是因为我正在收到错误的日期错误 使用未定义的关键字值0x1用于事件ApplicationStarted. 它正在编译正常但是当我们尝试使用以下行启用日志事件时抛出运行时错误

listener.EnableEvents(Logger.Log, EventLevel.LogAlways, Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Keywords.All);

这是我的事件来源

public static readonly Logger Log = new Logger();
        [Event(100, Level = EventLevel.Informational, Keywords = Keywords.Application, Task = Tasks.ApplicationStarted, Opcode = Opcodes.Start, Version = 1)]
        public void ApplicationStarted()
        {
            if (this.IsEnabled(EventLevel.Informational, Keywords.Application))
            {
                this.WriteEvent(100);
            }
        }

        [Event(101, Level = EventLevel.Informational, Keywords = Keywords.Application, Task = Tasks.ApplicationClosed, Opcode = Opcodes.Closed, Version = 1)]
        public void ApplicationClosed()
        {
            if (this.IsEnabled(EventLevel.Informational, Keywords.Application))
            {
                this.WriteEvent(101);
            }
        }
Run Code Online (Sandbox Code Playgroud)

.net c# logging enterprise-library slab

3
推荐指数
1
解决办法
803
查看次数