本文介绍了在接口中声明构造函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我通过界面访问我的数据库,以允许将来物理数据存储的替换 - 因此我想在我的 接口中声明我的DAL-实现接口和访问 数据存储区的对象必须传入对象构造函数中的UserToken。 这是不可能的吗? 我是否被迫将UserToken作为对象的属性添加? / Ole 解决方案 --- 收到的邮件经过无病毒认证。 由AVG反查病毒系统( http://www.grisoft.com)。 版本:6.0.760 /病毒库:509 - 发布日期:10/09/2004 [microsoft.public.dotnet.languages.csharp] 的接口 >数据存储区必须在对象的构造函数中传入UserToken。> >这不可能吗?>我是否被迫将UserToken作为对象的属性添加?> > / Ole > > > --- 收到的邮件经过无病毒认证。由AVG反病毒系统( http://www.grisoft.com)检查。 版本:6.0.760 /病毒库:509 - 发布日期:10/09/2004 [microsoft.public.dotnet.languages.csharp] I am accessing my database through an interface, to allow futuresubstitution of the physical datastore - hence I would like to declare in myInterface that my DAL-objects implementing the interface and accessing thedatastore MUST pass in a UserToken in the constructor of the object.Is this not possible?Am I forced to add the UserToken as a property on the object instead?/Ole 解决方案---Incoming mail is certified Virus Free.Checked by AVG anti-virus system (http://www.grisoft.com).Version: 6.0.760 / Virus Database: 509 - Release Date: 10/09/2004[microsoft.public.dotnet.languages.csharp]the > datastore MUST pass in a UserToken in the constructor of the object. > > Is this not possible? > Am I forced to add the UserToken as a property on the object instead? > > /Ole > > > --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.760 / Virus Database: 509 - Release Date: 10/09/2004 [microsoft.public.dotnet.languages.csharp] 这篇关于在接口中声明构造函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!