How to place filters or conditions on navigation properties in Entity
Framework
I have a table in my sql database called 'Clients' and in that table is a
field called status. It can contain 2 values, 'A' for active or 'I' for
inactive. Meanwhile in my mvc web application using Entity Framework I
have implemented the repository pattern with a specific ClientRepository.
Whenever I make a call to the ClientRepository there is a predefined
filter that ensures all queries are filtered and that only status 'A'
records are returned.. and all is well.
The problem that I am facing now is when I use LINQ to query a table that
is linked to Clients, eg - ClientOrders and then access the navigation
property called Clients. When I do so it retrieves all clients with any
'status' including 'I'.
Does anyone know if there is a way to configure E.F. in the designer or
context to set conditions on navigation properties to satisfy my
requirements such that only status 'A' will be returned?
Note that this is one example of many cases in my application that use
'status' as a record indicator and there are multiple navigation
properties I will need to apply a fix to.
Thanks.
Thursday, 3 October 2013
Wednesday, 2 October 2013
Adding Responsive Framework
Adding Responsive Framework
I'm creating a site which I plan to utilize parallax scrolling and
responsive framework. By theory, is it ok to do the responsive framework
last as I'd like to finish the layout of the site before adding my
settings for the responsive framework?
I'm creating a site which I plan to utilize parallax scrolling and
responsive framework. By theory, is it ok to do the responsive framework
last as I'd like to finish the layout of the site before adding my
settings for the responsive framework?
How to fix the issue git commit diverged?
How to fix the issue git commit diverged?
I am little bit familiar with git and and have successfully done the git
clone, commit etc on my project. But now there is a complex situation
comes in my project because of git. When i check the git status there is a
message like
Your branch and 'origin/develop' have diverged. and have 5 and 3
different commits each, respectively.
Also i am attaching here my git network diagrom
Any body can help to fix this issue?
I am little bit familiar with git and and have successfully done the git
clone, commit etc on my project. But now there is a complex situation
comes in my project because of git. When i check the git status there is a
message like
Your branch and 'origin/develop' have diverged. and have 5 and 3
different commits each, respectively.
Also i am attaching here my git network diagrom
Any body can help to fix this issue?
Upgrading from MySQL 4.7 to 5.5, problematic date fields
Upgrading from MySQL 4.7 to 5.5, problematic date fields
I get this error in a legacy application running SQL from JSP pages (not
my app):
java.sql.SQLException: Value '7Some text from a field123133
2001-09-2012001-10-01 08:37:1910000-00-00 00:00:00' can not be represented
as java.sql.Timestamp/p /blockquote pIt looks like the fields are
concatenated and that is what the timestamp (and date, and datetime) is
trying to decipher. Everything works fine if I run the query in mysql
client and if I remove all date, datetime and timestamp fields. This
happens when executeQuery(query) is run./p pWhat I've done:/p ul
limysqldump the old database/li liimported to the new/li lichanged the old
mysql driver to mysql-connector-java-5.1.26-bin.jar/li liremoved any old
jdbc libraries/li litomcat is running on java 1.7/li /ul pI'm guessing
it's a problem with libraries./p ul liapache-tomcat-7.0.42/li
li5.5.32-0ubuntu0.12.04.1 (Ubuntu)/li lijdk1.7.0_15/li /ul pHere's the
tomcat/lib:/p pactivation.jar catalina-tribes.jar el-api.jar jmxtools.jar
naming-factory.jar poolman.xml tomcat-i18n-es.jar annotations-api.jar
commons-codec-1.4.jar hssf-serializer.jar jsp-api.jar NetComponents.jar
servlet-api.jar tomcat-i18n-fr.jar catalina-ant.jar cos.jar jasper-el.jar
log4j.jar pg73jdbc3.jar tomcat-api.jar tomcat-i18n-ja.jar catalina-ha.jar
dnsjava.jar jasper.jar mail.jar poi-hssf.jar tomcat-coyote.jar
tomcat-jdbc.jar catalina.jar ecj-4.2.2.jar jmxri.jar
mysql-connector-java-5.1.26-bin.jar poolman.jar tomcat-dbcp.jar
tomcat-util.jar/p pAnd a few in the WEB-INF/lib:/p pfop.jar jce1_2_1.jar
jsse.jar NetaxeptClientVirtual.jar soap.jar w3c.jar xerces.jar/p pThanks
for any help!/p
I get this error in a legacy application running SQL from JSP pages (not
my app):
java.sql.SQLException: Value '7Some text from a field123133
2001-09-2012001-10-01 08:37:1910000-00-00 00:00:00' can not be represented
as java.sql.Timestamp/p /blockquote pIt looks like the fields are
concatenated and that is what the timestamp (and date, and datetime) is
trying to decipher. Everything works fine if I run the query in mysql
client and if I remove all date, datetime and timestamp fields. This
happens when executeQuery(query) is run./p pWhat I've done:/p ul
limysqldump the old database/li liimported to the new/li lichanged the old
mysql driver to mysql-connector-java-5.1.26-bin.jar/li liremoved any old
jdbc libraries/li litomcat is running on java 1.7/li /ul pI'm guessing
it's a problem with libraries./p ul liapache-tomcat-7.0.42/li
li5.5.32-0ubuntu0.12.04.1 (Ubuntu)/li lijdk1.7.0_15/li /ul pHere's the
tomcat/lib:/p pactivation.jar catalina-tribes.jar el-api.jar jmxtools.jar
naming-factory.jar poolman.xml tomcat-i18n-es.jar annotations-api.jar
commons-codec-1.4.jar hssf-serializer.jar jsp-api.jar NetComponents.jar
servlet-api.jar tomcat-i18n-fr.jar catalina-ant.jar cos.jar jasper-el.jar
log4j.jar pg73jdbc3.jar tomcat-api.jar tomcat-i18n-ja.jar catalina-ha.jar
dnsjava.jar jasper.jar mail.jar poi-hssf.jar tomcat-coyote.jar
tomcat-jdbc.jar catalina.jar ecj-4.2.2.jar jmxri.jar
mysql-connector-java-5.1.26-bin.jar poolman.jar tomcat-dbcp.jar
tomcat-util.jar/p pAnd a few in the WEB-INF/lib:/p pfop.jar jce1_2_1.jar
jsse.jar NetaxeptClientVirtual.jar soap.jar w3c.jar xerces.jar/p pThanks
for any help!/p
Tuesday, 1 October 2013
How to build a Wordpress form searching posts in a specific category only or sitewide?
How to build a Wordpress form searching posts in a specific category only
or sitewide?
I want to build a Wordpress search from that if somebody selects "Game",
it searches posts in the "Game" category. Or if he/she chooses "The rest
of the site", it searches posts/pages in the site except posts in the
"Game" category. I think radio button is a good option for the selection.
How do I do it? Cheers.
or sitewide?
I want to build a Wordpress search from that if somebody selects "Game",
it searches posts in the "Game" category. Or if he/she chooses "The rest
of the site", it searches posts/pages in the site except posts in the
"Game" category. I think radio button is a good option for the selection.
How do I do it? Cheers.
UIPicker no longer working iOS7
UIPicker no longer working iOS7
Hi My UI Picker no longer works on iOS7, it pops up but it is blank. Only
happened on iOS7.
//picker
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row
inComponent:(NSInteger)component{
animationsLabel.text = [optionsArray objectAtIndex:[picker
selectedRowInComponent:0]];
if (pickerView==animationsPicker) {
animationsLabel.text = [optionsArray objectAtIndex:[animationsPicker
selectedRowInComponent:0]];
}
}
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
return 1;
}
-(NSInteger)pickerView:(UIPickerView *)pickerView
numberOfRowsInComponent:(NSInteger)component{
return [optionsArray count];
}
-(NSString *)pickerView:(UIPickerView *)pickerView
titleForRow:(NSInteger)row forComponent:(NSInteger)component{
return [optionsArray objectAtIndex:row];
NSLog(@"title options array %lu",(unsigned long)optionsArray.count);
}
and the action:
-(IBAction)animationActionSheet:(id)sender {
UIActionSheet *selectPopup = [[UIActionSheet alloc]
initWithTitle:@"\n\n\n\n\n\n\n\n"
delegate:nil
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:nil];
[selectPopup showInView:self.view];
optionsArray = [[NSMutableArray alloc]
initWithObjects:@"1",@"2",@"3",@"4",@"6",@"5",@"7",@"8",@"9", nil];
// Create picker
animationsPicker = [[UIPickerView alloc] initWithFrame:CGRectMake(10, 160,
320, 100)];
animationsPicker.showsSelectionIndicator = YES;
[self.view addSubview:animationsPicker];
animationsPicker.delegate = self;
animationsPicker.dataSource = self;
[selectPopup addSubview:animationsPicker];
// Animate picker opening
[UIView beginAnimations:nil context:nil];
[selectPopup setBounds:CGRectMake(0, 0, 320, 485)];
[UIView commitAnimations];
}
This is what I have tried so far. There was never a problem displaying the
picker in the an Action sheet before, but now it is blank. Im wondering
did anyone else come across this problem, or can you see any errors? I
printed everything to do with the picker.
Hi My UI Picker no longer works on iOS7, it pops up but it is blank. Only
happened on iOS7.
//picker
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row
inComponent:(NSInteger)component{
animationsLabel.text = [optionsArray objectAtIndex:[picker
selectedRowInComponent:0]];
if (pickerView==animationsPicker) {
animationsLabel.text = [optionsArray objectAtIndex:[animationsPicker
selectedRowInComponent:0]];
}
}
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
return 1;
}
-(NSInteger)pickerView:(UIPickerView *)pickerView
numberOfRowsInComponent:(NSInteger)component{
return [optionsArray count];
}
-(NSString *)pickerView:(UIPickerView *)pickerView
titleForRow:(NSInteger)row forComponent:(NSInteger)component{
return [optionsArray objectAtIndex:row];
NSLog(@"title options array %lu",(unsigned long)optionsArray.count);
}
and the action:
-(IBAction)animationActionSheet:(id)sender {
UIActionSheet *selectPopup = [[UIActionSheet alloc]
initWithTitle:@"\n\n\n\n\n\n\n\n"
delegate:nil
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:nil];
[selectPopup showInView:self.view];
optionsArray = [[NSMutableArray alloc]
initWithObjects:@"1",@"2",@"3",@"4",@"6",@"5",@"7",@"8",@"9", nil];
// Create picker
animationsPicker = [[UIPickerView alloc] initWithFrame:CGRectMake(10, 160,
320, 100)];
animationsPicker.showsSelectionIndicator = YES;
[self.view addSubview:animationsPicker];
animationsPicker.delegate = self;
animationsPicker.dataSource = self;
[selectPopup addSubview:animationsPicker];
// Animate picker opening
[UIView beginAnimations:nil context:nil];
[selectPopup setBounds:CGRectMake(0, 0, 320, 485)];
[UIView commitAnimations];
}
This is what I have tried so far. There was never a problem displaying the
picker in the an Action sheet before, but now it is blank. Im wondering
did anyone else come across this problem, or can you see any errors? I
printed everything to do with the picker.
What does this notation denote?
What does this notation denote?
What does the following notation denote: $$\bigcup_{i=1}^\infty
\bigcap_{j\ge i}^\infty A_i$$
A. All elements that are in finitely many $A_i$;
B. All elements that are in infinitely many $A_i$;
C. All elements that are in all but infinite numbers of $A_i$;
Please help me, thank you.
What does the following notation denote: $$\bigcup_{i=1}^\infty
\bigcap_{j\ge i}^\infty A_i$$
A. All elements that are in finitely many $A_i$;
B. All elements that are in infinitely many $A_i$;
C. All elements that are in all but infinite numbers of $A_i$;
Please help me, thank you.
Dual monitor wont play media centre on primary screen
Dual monitor wont play media centre on primary screen
I am running ubuntu 13.04 on a laptop that is connected to my TV.
Everything seems to work fine but when I open my media centre (XBMC) it
will only run in full screen on the laptop. I have changed the display
settings to a dual screen set up with the TV as the launcher screen but
the only way i can get XBMC on the TV is to run it in a window and drag it
over to the TV. Can anyone help me? Should I have version 12.04 instead?
I am running ubuntu 13.04 on a laptop that is connected to my TV.
Everything seems to work fine but when I open my media centre (XBMC) it
will only run in full screen on the laptop. I have changed the display
settings to a dual screen set up with the TV as the launcher screen but
the only way i can get XBMC on the TV is to run it in a window and drag it
over to the TV. Can anyone help me? Should I have version 12.04 instead?
Subscribe to:
Comments (Atom)