I'm working with a legacy system that I'm experimenting with adding NHibernate to. I have class that I need to be mapped to a table, but it has lots of existing methods that are not virtual.
I discovered that I can get NHibernate to load the mapping successfully even with the non-virtual methods present if I set the "lazy" attribute on...
I've got the following code :
public class A
{
~A()
{
Console.WriteLine("destructor");
}
}
public static A Aref;
static void Main(string[] args)
{
Aref = new A();
int gen = GC.GetGeneration(Aref);
Aref = null;
GC.Collect(gen, GCCollectionMode.Forced);
...
Hi,
Does .net have any propertyset design/architecture?
something like: http://www.opensymphony.com/propertyset/usage.jsp
Or specifically: http://ofbiz.apache.org/docs/entity.html
Is this how the entity framework is or is that different? Does it have an expernal .xml file that has mapping info?
...
I am trying to get the subset of items in dataA that are in dataB, and have different values of property c. The properties a and b can be used as an index, so I have tried to filter out only the useful pairs then check to see if they have a different c value.
This is the linq expression I came up with, and it does work, but It seems li...
Is it legal to write the following in .net ?
public class A
{
public int i = 0;
~A()
{
Aref = this;
}
}
public static A Aref;
static void Main(string[] args)
{
Aref = new A();
int gen = GC.GetGeneration(Aref);
Aref = null;
GC.Collect(gen...
I used to use JavaBlackBelt a lot when I was first learning java, I have now switched to .Net and I was wondering if there was an equivalent site?
...
Hi,
I have a domain class with a property IList<string> that I want to map to a table with a single data value (i.e. it has an ID, a foreign key ID to the domain entity table, and a varchar data column).
I keep getting the error: 'Association references unmapped class: System.String'.
How can I map a table to a collection of strings?
...
In the following code MessageReceived is on a different thread to label1 and when trying to access it I will get this error:
Cross-thread operation not valid:
Control 'label1' accessed from a
thread other than the thread it was
created on.
foo.MessageReceived += new Agent.MessageReceivedHandler(foo_MessageReceived);
void fo...
I have a data object (let's say it's called 'Entry') that has a set of potential states that look something like this:
1 - Created
2 - File added
3 - Approved
4 - Invalid
This is represented in the database with a 'Status' table with an autonumber primary key, then a 'StatusId' field in the main table, with the appropriate relationship...
I'm losing my mind trying to find a table showing all the formats of datetimes for cultures
I've been googling like crazy and all i want is that table! ARG
i.e.
en-CA = DD/MM/YYYY 0.00
en-FR = MM/DD/YYYY 0,00
I'm looking for a link to MSDN or wikipedia - I know I've seen this in the past before
...
I'm learning LINQ to XML and need to find the existence of an element with a particular attribute. At the moment I'm using:
XElement groupCollectionXml = XElement.Parse(groupCollection.Xml);
IEnumerable<XElement> groupFind =
from vw in groupCollectionXml.Elements("Group")
where (string) vw.Attribute("Name") == groupName
sele...
I would like to implement conversion between two library classes by Convert.ChangeType in C#. I can change neither of the two types. For example converting between Guid and byte[].
Guid g = new Guid();
object o1 = g;
byte[] b = (byte[]) Convert.ChangeType(o1, typeof(byte[])); // throws exception
I am aware that Guid provides a ToByteA...
I am trying to wrap my head around the control infrastructure to understand which ones ASP.NET maintains view state for.
There are these regular HTML controls ex:
<input type="radio" checked="checked"/> -> I understand these do not have viewstate
Then there are HTML controls with runat="server"
<input type="radio" checked="checked" run...
I have a super basic form that shoots out an email. The code is contained within a virtual directory like http://url/emailer/emailer.aspx on a new server and is working fine.
We are in the process of migrating a few additional sites over to this new server. To test, I'm accessing the files via the ip address so I can see the site on the...
I have a WCF service that is using webHttpBinding on an endpoint, and the WCF service is hosted as a windows service. Is it possible to secure this at the transport level by using HTTPS or some other method?
...
Here is a simplified example of what I am trying to achieve;
<asp:CheckBox runat="server" Checked="<%# this.isChecked %>" id="myCheckBox" />
Then in my code behind;
public partial class _Default : System.Web.UI.Page
{
bool _isChecked = true;
public string isChecked
{
get
{
return _isChecked.ToString();
...
How do I order by a passed string value on my list of objects? i need to do paging and sorting on my List(Of) objects the paging is no problem but I don;t know who to get the Order By to work.
Here is what I am currently doing and it's working great:
Return returnReports.Skip(PageSize * (PageNumber-1)).Take(PageSize).ToList()
How do ...
Anyone know or use an open source MPG to FLV converter that I would be able to use programatically? Preferably .NET . If you know any .NET commercial ones also then I would be grateful of those links too.
Cheers,
Andrew
...
The Type.MakeByRefType method in .NET returns a by-ref version of a type, e.g. passing the type of System.Int32 returns a type representing System.Int32&.
However, if you already have a System.Int32&, what is the mechanism for obtaining a plain old System.Int32? There doesn't seem to be an opposite method to remove the by-ref modifier.
...
If I have the following control:
public partial class MyControl : UserControl{
public string MyControlText{
get { return MyTextBox.Text; }
set { MyTextBox.Text = value; }
}
public MyControl(){ ... }
}
How can I bind to the "MyControlText" property when I place the control on one of my pages, like so:
<lo...